home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / Barfly / Docs / Barfly.man < prev    next >
Encoding:
Text File  |  2000-01-01  |  184.0 KB  |  6,511 lines

  1. This file documents Barfly, a development system for AmigaOS V2.04 or
  2. newer.
  3.  
  4.  
  5.  
  6.                               Barfly 1.0
  7.  
  8.        An Intuition controled Debugger and Optimizing Assembler
  9.  
  10.                   Copyright (c) 1989-98 Ralph Schmidt
  11.  
  12.                              - Shareware -
  13.  
  14. Basic Informations
  15. ******************
  16.  
  17. Copyright and other legal stuff
  18. ===============================
  19.  
  20.    Copyright (c) 1989-98 Ralph Schmidt
  21.  
  22.    Permission is granted to make and distribute verbatim copies of this
  23. manual provided the copyright notice and this permission notice are
  24. preserved on all copies.
  25.  
  26.    No guarantee of any kind is given that the programs described in
  27. this document are 100% reliable. You are using this material at your
  28. own risk. The author *can not* be made responsible for any damage which
  29. is caused by using these programs.
  30.  
  31.    Permission is granted to include this package in Public-Domain
  32. collections, especially in Fred Fishs Amiga Disk Library (including
  33. CD-ROM versions of it).  The distribution file may be uploaded to
  34. Bulletin Board Systems or FTP servers. If you want to distribute this
  35. program you *must* use the original distribution archive `Barfly.lha'.
  36.  
  37.    *None* of the programs may be included or used in commercial programs
  38. unless by written permission from the author.
  39.  
  40.    *None* of the programs may be modified in any way. This especially
  41. includes changing the copyright notices or removing any of the Shareware
  42. restrictions.
  43.  
  44.    *None* of the programs may be used on any machine which is used for
  45. the research, development, construction, testing or production of
  46. weapons or other military applications. This also includes any machine
  47. which is used for training persons for *any* of the above mentioned
  48. purposes.
  49.  
  50.    *None* of the programs may be used by more than the registrated
  51. owner.
  52.  
  53. Registration
  54. ============
  55.  
  56.    Well...i decided to release it as GiftWare now with a PUBLIC key.
  57. The PPC/ELF support may be useful for some people and i just don`t have
  58. the time anymore to handle some few registrations.  If somebody thinks
  59. it`s a nice product he`s free to send me whatever he thinks is
  60. appropriate.
  61.  
  62.    *Here you can read the old registration text...*
  63.  
  64.    As you may have noticed in the copyright I'm working for five years
  65. at Barfly. It has always consumed and will continue to consume a large
  66. amount of my time.
  67.  
  68.    I cannot afford just working for fun. Thus, I decided to release
  69. Barfly as Shareware. I had already tried to release Barfly as a
  70. commercial product but the story behind it is more than sad. To sum
  71. it...german Amiga software companys aren't worth any time...`they suck'.
  72. Some people may think the price is too high for a Shareware product but
  73. i think that BAsm is as powerful as the 2 main available commercial
  74. Assemblers...if not more powerful if you compare the speed and the
  75. optimize functions;there's no commercial Debugger available that can
  76. compete with BDebug.  I've used Barfly myself for commercial Amiga
  77. applications.  Cyberstorm 060, Z3-Fastlane device, CDRive,
  78. SCSIConfig,...
  79.  
  80.    The unregistered version of Barfly pops up the About requester at
  81. the start and has some functions disabled:
  82.      Assembler:
  83.       o only 8192Bytes large code possible
  84.       o the Section commands aren't available
  85.      Debugger:
  86.       o Only 1 Window per Object
  87.       o Enforcer,CyberGuard Catch not available
  88.       o Task Catch not available
  89.       o Crashed Task Catch not available
  90.       o Limited Step count(about 150-200 Steps)
  91.  
  92.    Registered users will be shipped a disk with the newest public
  93. release of Barfly, along with a personalized, so-called "keyfile". It
  94. enables all the missing features and disables the Shareware reminders.
  95. This keyfile will work with all future releases of Barfly, so you can
  96. simply download the latest version from your local bulletin board
  97. without having to wait weeks for your update passing through the slow
  98. mail channels. The keyfile `must not' be distributed in any way.
  99.  
  100. The fee for a Barfly registration is
  101.       70.- DM  (D-Mark),
  102.       70.- SFr (Schweizer Franken),
  103.      230.- FF  (French Francs),
  104.       50.- US$ (US Dollar)
  105.  
  106.    There is NO splitted version available. Only Barfly and Basm
  107. together.
  108.  
  109.    The fastest, cheapest and easiest way to register is put the money
  110. together with the filled registration form into a letter and send it to
  111.  
  112.    Please allow 2-8 weeks delivery for the registrated version.
  113. Currently I am very busy with my civil service and working for Phase5 so
  114. please be patient.
  115.  
  116.      Ralph Schmidt
  117.      Kleiner Hellweg 4
  118.      33154 Salzkotten
  119.      FR Germany
  120.      Phone: Nahh..not anymore:-)
  121.      E-Mail: laire@popmail.owl.de
  122.         Irc: Laire on #amiga,#amigager
  123.  
  124. Introduction
  125. ************
  126.  
  127. Purpose
  128. =======
  129.  
  130.    BDebug is an Intuition controled multi-task system Debugger for OS
  131. 2.04 and newer.
  132.  
  133.    You can use BDebug to debugging your programs, catching tasks,
  134. reseach Enforcer and CyberGuard hits, follow Source-Level Informations
  135. and other advanced functions.  The Debugger supports assemblers, SAS C,
  136. Dice and GCC.
  137.  
  138. Some of BDebug's features are:
  139.  
  140.    * font-sensitive, resizable and Style Guide compliant GadTools GUI
  141.  
  142.    * Object-Oriented that results in a low learning curve
  143.  
  144.    * Supports 68000...68060 and the FPUs
  145.  
  146.    * Supports the PPC603/604/740/750/7400
  147.  
  148.    * Supports PPC ELF object format
  149.  
  150.    * Can debug multiple tasks at the same time
  151.  
  152.    * Not limited by the amount of window objects.
  153.  
  154.    * highly configurable
  155.  
  156.    * keyboard support
  157.  
  158.    BAsm is a very fast optimizing Assembler for OS 2.04 and newer.
  159.  
  160. Some of BAsm's features are:
  161.  
  162.    * 68000-68060, 6888x and PPC603,PPC604,PPC740/PPC750,PPC7400
  163.  
  164.    * Very Fast
  165.  
  166.    * Include and Incbin Cache
  167.  
  168.    * Strong Optimizer with Multi-Pass Optimizing
  169.  
  170.    * High Level Macros
  171.  
  172.    * ARexx
  173.  
  174.    * Supports OS 2.04 and OS 3.0 Hunks
  175.  
  176.    * SAS D1 Source Level Format
  177.  
  178. System requirements
  179. ===================
  180.  
  181.    Barfly requires Amiga operating system version 2.04 or better.
  182.  
  183.    Kickstart 1.3 is *not* supported; this operating system is considered
  184. obsolete.
  185.  
  186.    Barfly requires at least one megabyte of RAM to run.  A hardisk or a
  187. faster CPU is not required but increase performances and comfort, of
  188. course.
  189.  
  190. Installation
  191. ============
  192.  
  193.    It is really easy to install Barfly:
  194.  
  195.    1. Copy the the binary and the icon (called "BDebug" and
  196. "BDebug.info")   to any directory.
  197.  
  198.    2. Copy the the binary and the icon (called "BAsm" and "BAsm.info")
  199. to any directory.
  200.  
  201.    Then copy the supplied configuration files from "s/Barfly/#?" to "S:"
  202. directory of your system partition or create env:Barflypath with the
  203. path to a directory that contains Barfly/#?.
  204.  
  205. Other topics
  206. ************
  207.  
  208. Updates
  209. =======
  210.  
  211.    Whenever a new release of Barfly gets released, I will post some
  212. information in the appropriate newsgroups of some electronic networks.
  213. The new archive will soon be available on many bulletin boards and on
  214. all `AmiNet' FTP servers. Major releases will also come with some PD
  215. disks, especially on Fred Fish's collection.
  216.  
  217.    As mentioned above, registered users will neither need a new keyfile
  218. nor a special personalized program version. They can use all new
  219. features immediately.
  220.  
  221. Support
  222. =======
  223.  
  224.    If you have some questions, comments, suggestions or even flames,
  225. please feel free to contact me at one of the following addresses. If
  226. you send your letter via e-mail, there's a good chance for getting a
  227. quick reply.
  228.  
  229.      Snailmail: Ralph Schmidt
  230.                 Kleiner Hellweg 4
  231.                 33154 Salzkotten
  232.                 FR Germany
  233.      
  234.          Phone: too bad:-)
  235.      
  236.         E-Mail: laire@popmail.owl.de
  237.            Irc: Laire on #amiga, #amigager
  238.  
  239. History
  240. =======
  241.  
  242.    * 0.0 - 1.0
  243.      not released
  244.  
  245.    * 1.0 - 1.31
  246.      the 68k version
  247.  
  248.    * 2.0 -
  249.      the PPC/ELF extension
  250.  
  251. Future
  252. ======
  253.  
  254. Here are some ideas for future versions of BDebug:
  255.  
  256.    * Full Source Level support for GCC and perhaps SAS.
  257.  
  258.    * Better BDebug Arexx support...the current one is a bad excuse.
  259.  
  260.    * Mungwall Trace methods.
  261.  
  262.    * Automatic Refresh of some Windows(Task Window...)
  263.  
  264.    * Amigaguide file mode in the autodocs functions.
  265.  
  266.    * Highlight changed registers
  267.  
  268.    * Better documentation.
  269.  
  270.    * BAsmOption for the easy BAsm options configuration.
  271.  
  272.    * Other things i'm too lazy to mention now.
  273.  
  274. Important:
  275.      There is absolutely NO guarantee that these features will ever be
  276.      implemented. So don't be disappointed, if they aren't in the next
  277.      version.
  278.  
  279. Acknowledegments
  280. ================
  281.  
  282. Thanks must go to:
  283.  
  284.    - Dirk Leschner, Frank Jakobs
  285.  
  286.      for being my best friends
  287.  
  288.    - Matthias Scheler
  289.  
  290.      for his manual design and Filer.
  291.  
  292.    - S.Schaem, Børge Nøst, Alexis Wilke, Michael B. Smith, Marc Heuler
  293.  
  294.      for their superb betatesting efforts
  295.  
  296.    - Mike Schwartz
  297.  
  298.      for a lot suggestions to improve basm. Sad he has left the Amiga
  299.      community 2 years ago.
  300.  
  301.    - Stefan Becker
  302.  
  303.      for Toolmanager and being a nice guy.
  304.  
  305.    - Christoph Wolf
  306.  
  307.      for DynamiCache and being a nice guy.
  308.  
  309.    - Brian Cerveny(Redwine)
  310.  
  311.      for Grapevine and being a nice guy.
  312.  
  313.    - All my IRC friends.
  314.  
  315.      for many great hours. Thanks!
  316.  
  317.      Andrew Denton(Guardian), Kenneth Dyke(Nyx), Bill Coldwell(Cryo),
  318.      Brian Cerveny(Redwine), Joseph Hillenburg(xterm), Scott
  319.      Ellis(ScottE), Chris Wichura(Caw), John Wiederhirn(John\_W), Mike
  320.      Schwartz(mykes), Markus Illenseer(ill), Holger Lubitz(holgi),
  321.      Ralph Babel(rbabel), Seth Harman(Budha) and a lot guys i haven't
  322.      mentioned here.
  323.  
  324.    - Chris Schneider and Urban D. Mueller
  325.  
  326.      for some suggestions 2-3 years ago and installing Aminet.
  327.  
  328.    - Michael "billy" Böhnisch
  329.  
  330.      for his cleanup on MakeBarflyFD 2-3 years ago.
  331.  
  332.    - Steve Wright
  333.  
  334.      for designing the icons 2 years ago.
  335.  
  336. And of course to all the other Beta testers and registered users.
  337.  
  338.    The V40 Includes can be ftp'ed from the FTP-Server.
  339.  
  340.    ftp.rz.uni-wuerzburg.de: pub/amiga/frozenfish/bbs/com
  341.  
  342.    A superb Linker "lk" by Alex Wilke should be soon availble on Aminet.
  343.  
  344.                               BDebug 1.0
  345.  
  346.                     An Intuition controled Debugger
  347.  
  348.                   Copyright (c) 1989-98 Ralph Schmidt
  349.  
  350.                              - Shareware -
  351.  
  352. Usage of BDebug
  353. ***************
  354.  
  355. The Command Window
  356. ==================
  357.  
  358. Debugger Philosophy
  359. ===================
  360.  
  361.    BDebug is a multitasking Debugger that supports the Motorola
  362. processors 68000...68060 and 68881...68882.  The Debugger allows to
  363. debug unlimited tasks parallel.  Because of the Debugger's complexity
  364. BDebug was designed in an object-oriented way to allow an easy and
  365. comfortable way to use it.  The register window `REGWindow' is the Root
  366. class of the task object that can be expanded by several subclass
  367. windows.  Every subclass window has privat menus and inherits the
  368. public menus of its father object.
  369.  
  370. Debug Methods
  371. =============
  372.  
  373.    The Debugger offers a variety of different Debug methods that can be
  374. activated by menu or gadget.
  375.  
  376. Debug Task
  377. ..........
  378.  
  379.    is used to select a task you wann to debug. If you doubleclick on a
  380. task a `REGWindow' and a couple of information windows opens.  Which
  381. type and how many are opened depends on the current configuration.
  382. After the task could be stopped the contents of the `REGWindow' and all
  383. other information windows gets refreshed.  If the task is in the `Wait'
  384. state the task is stopped when it gets a signal.
  385.  
  386.                          Task Listview Layout
  387.  
  388.                                    
  389.                 Taskaddress & Priority & Status & Name
  390.  
  391.                         Process Listview Layout
  392.  
  393.                                    
  394.       Taskaddress & Priority & Status & Name[CLI Number,CLI Name]
  395.  
  396.    You should know what task you can stop and what kind of task should
  397. never be stopped. For example the Input.device should never be stopped.
  398.  
  399. Debug File
  400. ..........
  401.  
  402.    is used to load and stop a program.  This function is equal to the
  403. bdebug cli startup with the exception that you can enter the parameter
  404. in a requester.  If no error occur all configurated windows are opened
  405. and the PC stops at the defined programstart breakpoint that normally
  406. points to the first command of the program.
  407.  
  408. Debug Next Task
  409. ...............
  410.  
  411.    is used to debug the next task that is opened.  The Debugger waits
  412. until another task is created by AddTask and a couple of information
  413. windows opens.  Which type and how many are opened depends on the
  414. current configuration.  After the new task was caught the pc points to
  415. the beginning of the task and `Catch Next Task' is disactivated.  To
  416. catch a program that is started from the WV you have to use `Debug Next
  417. Task' to catch the WB Startup Task `WBL' that starts the program.  Now
  418. you have to activate `Debug Next Task' again and let the current task
  419. run.  After a short time the task `WBL' ends and the program's task is
  420. caught.
  421.  
  422.      You should avoid to start a new task between the 2 `Debug Next
  423.      Task' phases because it's easy to catch the wrong one.
  424.  
  425.  
  426.      You should notice that `AddTask' is patched and points to a new
  427.      routine. Thus you should be careful with programs that also patch
  428.      `AddTask'. Furthermore it's useful to know in what sequences these
  429.      patches have to be removed.  The Debugger can only be closed when
  430.      all patched system function that were installed after the Debugger
  431.      was started are removed.
  432.  
  433.  
  434.      If you start a program in the shell without `c:Run' no new task is
  435.      created. Instead the program is run as a subroutine in shell's
  436.      task so you can't catch the task that easy.
  437.  
  438.  
  439. Debug Crashed Task
  440. ..................
  441.  
  442.    is used to catch tasks that crash so you track down the bug location
  443. a lot easier. If the system itself doesn't run anymore you shouldn't
  444. expect that bdebug still runs because it depends on a working system.
  445. If a task crashes and the option `Debug Crashed Task' is activated a
  446. couple of information windows opens. Which type and how many are opened
  447. depends on the current configuration.  `Task Held Requester'.
  448.  
  449. Catch Enforcer Hit
  450. ..................
  451.  
  452.    is used to tell the Debugger to stop the task it controls when an
  453. Enforcer or CyberGuard hit happens.  Unfortunately the Debugger can't
  454. always stop the task at exactly the same location where the hit
  455. happened.  Mostly the hit command is 1-2 instructions above the stopped
  456. task's PC.
  457.  
  458.    This function needs Enforcer V37.x by M. Sinz or CyberGuard V1.x and
  459. it must be installed before BDebug is launched.  Please read the
  460. documentation.
  461.  
  462. Select Display Mode
  463. ...................
  464.  
  465.    This function allows you to choose Screen Mode for the Debugger.
  466.  
  467. How to start ?
  468. ==============
  469.  
  470.    If you only want to debug a program you have to start bdebug with
  471. the program's name and parameters or by using `Debug Program' in the
  472. command window.  Another method is to move a program's icon on the
  473. command window or specify BDebug as in the icon as the `DefaultTool'.
  474.  
  475.    `Name:'
  476.  
  477.      BDEBUG - The CLI Startup
  478.  
  479.  
  480.    `Synopnis:'
  481.  
  482.      BDEBUG [?] [<Program> [Argument] ]
  483.  
  484.  
  485.    `Function:'
  486.  
  487.      BDebug activates the Debugger, loads and stops the optionally
  488.      entered program. If it can find a local config file with  the
  489.      suffix *.bdebug it loads it.
  490.  
  491.  
  492.    `Inputs'
  493.  
  494.         * ? shows an information message
  495.  
  496.         * program name If no program name is entered BDebug looks for
  497.           env:BDebugProgram and loads the program instead that the env:
  498.           points to.
  499.  
  500.         * argument line of the program. If there are spaces in
  501.           parameters you have to enclose the argument with `""'.
  502.  
  503.  
  504. Usage of BDebug
  505. ***************
  506.  
  507. The Register Window
  508. ===================
  509.  
  510. Register Window
  511. ---------------
  512.  
  513.    The register window is the most important control layer of the
  514. Debugger and every debugged task has one.  You can link unlimited other
  515. information windows to the `REGWindow' or you can tell the Debugger to
  516. give up controling the task.  In the title line of the window you can
  517. see the ID number of the task, so you can recognize what information
  518. window belongs to this task.  Furthermore the title line also contains
  519. the task address, the state, `RUN', `WAIT' or `STOP' and the name of
  520. the task.  The task is in the `RUN' state if the task has the control
  521. at the moment instead of the traphandler; the task is in the `STOP'
  522. state when the task waits and the traphandler controls what happens.
  523. The task is the `WAIT' state only when the Debugger has to wait to
  524. catch a task by a `Debug Task'.  In the upper area of the window you
  525. see the normal data and address registers where the address register
  526. also have additional information fields.  To change a register or to
  527. watch memory where the register points to you only need to doubleclick
  528. on the register or on the register's memory contents.  Furthermore you
  529. may change other usermode registers by this method.  Supervisor
  530. register can't be changed because that doesn't make much sense for a
  531. system Debugger.
  532.  
  533.                            `68000 Registers'
  534.  
  535.              D0=xxxxxxxx yyyy A0=xxxxxxxx   Arg1 Arg2 [!]
  536.  
  537.              D1=xxxxxxxx yyyy A1=xxxxxxxx   Arg1 Arg2 [!]
  538.  
  539.              D2=xxxxxxxx yyyy A2=xxxxxxxx   Arg1 Arg2 [!]
  540.  
  541.              D3=xxxxxxxx yyyy A3=xxxxxxxx   Arg1 Arg2 [!]
  542.  
  543.              D4=xxxxxxxx yyyy A4=xxxxxxxx   Arg1 Arg2 [!]
  544.  
  545.              D5=xxxxxxxx yyyy A5=xxxxxxxx   Arg1 Arg2 [!]
  546.  
  547.              D6=xxxxxxxx yyyy A6=xxxxxxxx   Arg1 Arg2 [!]
  548.  
  549.              D7=xxxxxxxx yyyy A7=xxxxxxxx   Arg1 Arg2 [!]
  550.  
  551.            USP=xxxxxxxx  SSP=xxxxxxxx  PC=xxxxxxxx  SR=xxxx
  552.  
  553.    * [!] shows if the address register points on an odd address.
  554.  
  555.    * if the address register points on an illegal memory area the char
  556.      `*' is shown in Arg1 and Arg2 to avoid crashes by reading non
  557.      readable io-addresses.  You can config the readable memory areas.
  558.  
  559.    * if the address register points on the following system structures
  560.      the name of the Node is shown in Arg1 and the Name of the
  561.      structure in Arg2.
  562.  
  563.         * Library
  564.  
  565.         * Device
  566.  
  567.         * Port
  568.  
  569.         * Task
  570.  
  571.         * Resource
  572.  
  573.         * MemHead
  574.  
  575.    * if the address register points to the custom chip area the name of
  576.      the register is shown in Arg1 and the ID-Word CUSTOM is shown in
  577.      Arg2.  Custom register map is $dff000-$dff200.
  578.  
  579.    * if the address register points to a symbol the symbol and the
  580.      contents is shown.
  581.  
  582.    * Otherwise 8Bytes of the memory are shown where the register points
  583.      to.  The 8 Bytes are shown hexadecimal in Arg1 and ascii in Arg2.
  584.  
  585.                            `68010 Registers'
  586.  
  587.                VBR=xxxxxxxx  SFC=xxxxxxxx  DFC=xxxxxxxx
  588.  
  589.                            `68020 Registers'
  590.  
  591.                VBR=xxxxxxxx  SFC=xxxxxxxx  DFC=xxxxxxxx
  592.  
  593.         MSP=xxxxxxxx  ISP=xxxxxxxx CACR=xxxxxxxx CAAR=xxxxxxxx
  594.  
  595.                            `68030 Registers'
  596.  
  597.                VBR=xxxxxxxx  SFC=xxxxxxxx  DFC=xxxxxxxx
  598.  
  599.         MSP=xxxxxxxx  ISP=xxxxxxxx CACR=xxxxxxxx CAAR=xxxxxxxx
  600.  
  601.                CRP=xxxxxxxxxxxxxxxx SRP=xxxxxxxxxxxxxxxx
  602.  
  603.            TT0=xxxxxxxx  TT1=xxxxxxxx   TC=xxxx PSR=xxxxxxxx
  604.  
  605.                            `68040 Registers'
  606.  
  607.                VBR=xxxxxxxx  SFC=xxxxxxxx  DFC=xxxxxxxx
  608.  
  609.                MSP=xxxxxxxx  ISP=xxxxxxxx CACR=xxxxxxxx
  610.  
  611.           URP=xxxxxxxx  SRP=xxxxxxxx   TC=xxxx  PSR=xxxxxxxx
  612.  
  613.         ITT0=xxxxxxxx ITT1=xxxxxxxx DTT0=xxxxxxxx DTT1=xxxxxxxx
  614.  
  615.                            `68060 Registers'
  616.  
  617.                VBR=xxxxxxxx  SFC=xxxxxxxx  DFC=xxxxxxxx
  618.  
  619.               CACR=xxxxxxxx  PCR=xxxxxxxx BUSCR=xxxxxxxx
  620.  
  621.           URP=xxxxxxxx  SRP=xxxxxxxx   TC=xxxx  PSR=xxxxxxxx
  622.  
  623.         ITT0=xxxxxxxx ITT1=xxxxxxxx DTT0=xxxxxxxx DTT1=xxxxxxxx
  624.  
  625.                            Type  Information
  626.  
  627.               xxxxxxxx  [Symbol] Mnemonic operand1[,...]]
  628.  
  629.             (EA): [Address1=Contents]...[Address2=Contents]
  630.  
  631.      In the `(EA)' line you can see the addresses and their contents
  632.      the current command accesses.  The contents of illegal addresses
  633.      aren't shown.
  634.  
  635. Local Menus
  636. -----------
  637.  
  638.    * Close Window
  639.  
  640.      closes the `REGWindow', all connected windows and disactivates the
  641.      Debugger for this task.  To disactivate the Debugger you have to
  642.      choose if the task should keep running so it's the task's business
  643.      to stop.  Furthermore you can end the task by runing the cleanup
  644.      routine of the task or just removing the task from the list but
  645.      this can cause sideeffects you can't always oversee.  If the task
  646.      is a process then the Remove option is equal to the Cleanup option.
  647.      If it's only a task the Cleanup option is equal to the Cleanup
  648.      option.  Note that the Remove option doesn't free any resources of
  649.      the task.
  650.  
  651.           You should really know what you're doing if you, for example,
  652.           remove a task from the system.
  653.  
  654.  
  655.    * ZOOM Windows
  656.  
  657.      expands all windows of the task.
  658.  
  659.    * Log File
  660.  
  661.      activates or disactivates the loging of the register and PC
  662.      changes.  Tip: Use CNC:0/0/640/100/History as the logfile and you
  663.      get an      automatic logfile history.
  664.  
  665.    * Big View
  666.  
  667.      shrinks the `REGWindow' to a 68000 register layout or expands it
  668.      back to the full layout.
  669.  
  670.    * Open DissWindow
  671.  
  672.      opens a DissWindow with the configured dimensions.
  673.  
  674.    * Open MemWindow
  675.  
  676.      opens a MemWindow with the configured dimensions.
  677.  
  678.    * Open FPUWindow
  679.  
  680.      opens a FPUWindow with the configured dimensions.  The menu is
  681.      only available if a FPU is installed.
  682.  
  683.    * Open BreakWindow
  684.  
  685.      opens a BreakpointWindow with the configured dimensions.
  686.  
  687.    * Open CoppWindow
  688.  
  689.      opens a CoppWindow with the configured dimensions.
  690.  
  691.    * Open StructWindow
  692.  
  693.      opens a StructWindow with the configured dimensions.
  694.  
  695.    * Open SnoopWindow
  696.  
  697.      opens a SnoopWindow with the configured dimensions.
  698.  
  699.    * Open WatchWindow
  700.  
  701.      opens a WatchpointWindow with the configured dimensions.
  702.  
  703.    * Open ChecksumWindow
  704.  
  705.      opens a ChecksumWindow with the configured dimensions.
  706.  
  707.    * Save Window Settings
  708.  
  709.      saves the positions and count of all window the current task
  710.      controls.  The saved file then contains the appropriate commands
  711.      you have to enter yourself into the configuration file.  Because
  712.      of the Debugger's window concept it doesn't make sense to save a
  713.      complete configuration file.
  714.  
  715. Public Menus
  716. ------------
  717.  
  718.    * Step 1
  719.  
  720.      runs the current command and stops the task afterwords.
  721.  
  722.    * Step X
  723.  
  724.      runs X commands and stops the task afterwards.
  725.  
  726.    * Step Debug Line
  727.  
  728.      runs commands until the PC encounters another source line.  If the
  729.      PC is outside the program or if no debug informations are
  730.      available a single step i used.  The command enters subroutines.
  731.  
  732.    * Trace Debug Line
  733.  
  734.      is similar to `Step Debug Line' with the exception that it runs
  735.      subroutines.
  736.  
  737.    * Trace over Calls
  738.  
  739.      runs the current command or subroutine and stops the task
  740.      afterwards.  Depending on the configuration and the memory area a
  741.      breakpoint or single steps are used.  If a crash happens in
  742.      certain program parts you should remove the command `Tracebreak'
  743.      from the configuration.
  744.  
  745.           You should avoid to use `Tracebreak' in Libraries and Devices
  746.           which are located in the ram.  If another task accesses the
  747.           routine at the same time you can expect an illegal exception.
  748.  
  749.  
  750.           Some Amiga MMU Setups don't like programs writing to the
  751.           kickstart rom. For example when breakpoints are set.
  752.  
  753.  
  754.    * Trace X over Calls
  755.  
  756.      runs X commands or subroutines and stops the task afterwards.
  757.      Depending on the configuration and the memory area a breakpoint or
  758.      single steps are used.
  759.  
  760.    * Trace Work
  761.  
  762.      is similar to the command `Trace over Calls' with the exception
  763.      that all commands are run.  This function is useful to trace loops.
  764.  
  765.  
  766.           Example:
  767.                      moveq        #10,d0
  768.                  0$:
  769.                      dbra         d0,0$
  770.  
  771.           If you use the function on the command `dbra' the Debugger
  772.           sets a breakpoint after the dbra and runs the task. It drops
  773.           back to single step when it hits a `Jmp', `bra', `rts'....
  774.  
  775.  
  776.    * Trace over OS-Calls
  777.  
  778.      runs the current command or the OS function and stops the task
  779.      afterwards.
  780.  
  781.    * Trace on Flow
  782.  
  783.      stops the task when a PC direction occurs.  This means the PC is
  784.      stopped when it hits a `Jsr', `Jmp', `bcc', `rts'....
  785.  
  786.    * Trace on Address
  787.  
  788.      runs the task until the PC is equal to the entered address.  This
  789.      function is not very fast because the task is running in single
  790.      step mode and after each instruction the PC is compared with the
  791.      address.
  792.  
  793.    * Trace out of OS
  794.  
  795.      runs the task until the PC is outside of the kickstart.  This
  796.      function is useful when you catch a task inside the OS and you
  797.      want to get as fast as possible back to the program's code.  It
  798.      works similar as `Trace on address'.
  799.  
  800.           You shouldn't use this command if your task only runs in the
  801.           kickstart.
  802.  
  803.  
  804.    * (PC)++
  805.  
  806.      jumps over the current command.  Useful to jump over `Illegal'
  807.      breakpoints used for debugging purposes in your program.
  808.  
  809.    * PC-2
  810.  
  811.      subtracts 2 Bytes from the PC.
  812.  
  813.    * Write Nop
  814.  
  815.      overwrites the current command with a `Nop'.
  816.  
  817.    * Write Illegal
  818.  
  819.      overwrites the current command with an `Illegal'.
  820.  
  821.    * Run Task
  822.  
  823.      runs the task and stops only on exceptions.
  824.  
  825.    * Run Watched Task
  826.  
  827.      runs the task in trace mode and stops when a WatchPoint condition
  828.      is true.  If there are no watchpoints the command behaves like
  829.      `Run Task'.
  830.  
  831.    * Run History Task
  832.  
  833.      runs the task in trace mode and saves the registers each step into
  834.      the history stack.
  835.  
  836.    * Stop Task
  837.  
  838.      stops the task.
  839.  
  840.    * Send Signal
  841.  
  842.      sends a signal to the task.  Default Signal is CTRL-C = 12
  843.  
  844.    * Undo Level
  845.  
  846.      sets the undobuffer's depth.
  847.  
  848.    * Undo
  849.  
  850.      undos the last changes in the registerframe.
  851.  
  852.    * View Refresh
  853.  
  854.      activates and disactivates the copperlist refresh after each trace
  855.      operation. This function is help for debugging programs which
  856.      install own copperlists.
  857.  
  858.    * Show (EA)
  859.  
  860.      activates and disactivates the output of the address and address
  861.      contents which are accessed by the current assembler command.
  862.  
  863.    * Symbol
  864.  
  865.      activates and disactivates the use of symbols in the `REGWindow'.
  866.  
  867.    * Delete Symbols
  868.  
  869.      erases all symbols of the task.
  870.  
  871.    * Copy Symbols
  872.  
  873.      can copy a symbol list of the task to a different task.  This
  874.      function is helpful if your task is started from another task and
  875.      you want to keep the symbol list.
  876.  
  877.    * Load Symbols
  878.  
  879.      loads the symbols of a program where you can select an alternative
  880.      process's segmentlist for calculating the symbol and debug
  881.      informations.  Normally you choose the same process but sometimes
  882.      it's helpful to select a different process.  For example, if the
  883.      task you debug is created in a program, you have to choose the
  884.      program's task to get the correct symbol addresses.
  885.  
  886.    * Set Hunklist
  887.  
  888.      sets a new segment list for the SourceWindow and some other hunk
  889.      related functions.  Because the position in the SourceWindow
  890.      depends on the segments sometimes help to load new symbols and
  891.      debug informations for this task.  If you load an alternative
  892.      Hunklist by selecting a custom task when you use `Load Symbols'.
  893.  
  894.    * Reset Hunklist
  895.  
  896.      removes the alternative hunklist.
  897.  
  898.    * Show Value
  899.  
  900.      shows the value of an argument.
  901.  
  902.    * Show Last Exception
  903.  
  904.      shows the last exception.
  905.  
  906.    * Open Task Window
  907.  
  908.      opens a window showing the task structure of the task.
  909.  
  910.    * Open System Window
  911.  
  912.      opens a window showing the ExecBase structure.
  913.  
  914.    * Open Proces Window
  915.  
  916.      opens a window showing the process structure of the process.
  917.  
  918.    * Open CLI Window
  919.  
  920.      opens a window showing the cli structure of the process.
  921.  
  922.    * Open Hunk Window
  923.  
  924.      opens a window showing the hunks of the process.
  925.  
  926.    * Open Symbol Window
  927.  
  928.      opens a window showing the symbols of the process.  If you
  929.      doubleclick on a symbol you get the hunk where the symbol is
  930.      located.
  931.  
  932.    * Open Library Window
  933.  
  934.      opens a window showing the libraries.  If you doubleclick on a
  935.      library entry it opens a `FD:' window that shows all functions of
  936.      the library when the library is defined in the `Barfly.FD' file.
  937.      Furthermore if you doublelick on a function you have the choice to
  938.      see the function in a `DissWindow' or the autodocs documentation.
  939.  
  940.    * Open Device Window
  941.  
  942.      opens a window showing the devices.
  943.  
  944.    * Open Resource Window
  945.  
  946.      opens a window showing the resources.
  947.  
  948.    * Open Port Window
  949.  
  950.      opens a window showing the public ports.
  951.  
  952.    * Open Resident Window
  953.  
  954.      opens a window showing the resident modules.
  955.  
  956.    * Open Interrupt Window
  957.  
  958.      opens a window showing the interrupts.
  959.  
  960.    * Open AutoDocs Window
  961.  
  962.      opens a filerequester which lets you choose the needed autodocs
  963.      information of a library.  This opens a window which shows all
  964.      functions of the chosen autodoc file.  If you now click on a
  965.      function another window is opened showing the function
  966.      documentation.
  967.  
  968.    * Open History Window
  969.  
  970.      opens a HistoryWindow showing the last saved registerframes of the
  971.      undobuffer. The undobuffer is organized in a way to make the first
  972.      entry become the last entry in the HistoryWindow.  The
  973.      HistoryWindow isn't updated automaticlly.
  974.  
  975.    * Stack Check
  976.  
  977.      controls the stack check. A warning is displayed if the register
  978.      A7 points out of the stack bounds or points on an odd address.
  979.      The Debugger only checks the task when the task gives back the
  980.      control to the traproutine, so it's not possible to notice every
  981.      stack problem.
  982.  
  983.           You should be aware that this function doesn't work with a
  984.           WShell task because the `WShell' doesn't set the correct
  985.           stack task values.
  986.  
  987.  
  988.    * Find Task of address
  989.  
  990.      tries to find the task which belongs to the entered address.  The
  991.      command checks if the address is in the task, process, cli,
  992.      mementry structure and the hunks.  It's not safe to assume that
  993.      the function can check all cases.
  994.  
  995.    * Load Binary
  996.  
  997.      loads a file with an optional length into a memory area.  If you
  998.      want the Debugger to automaticlly allocate the memory block you
  999.      have to close the memory requester.
  1000.  
  1001.    * Save Binary
  1002.  
  1003.      saves a memory area into a file.
  1004.  
  1005.    * Freeze Task
  1006.  
  1007.      freezes a selectable task.  When bdebug ends the frozen tasks are
  1008.      awakened again.
  1009.  
  1010.    * Warm up Task
  1011.  
  1012.      warms up a frozen task.
  1013.  
  1014.    * Kill Task
  1015.  
  1016.      kills a selectable task.
  1017.  
  1018.           You should know which task you can kill.  For example, don't
  1019.           kill the input.device or your filesystem.
  1020.  
  1021.  
  1022.    * Show Task
  1023.  
  1024.      shows the task structure of a selectable task.
  1025.  
  1026.    * Show Prozess
  1027.  
  1028.      shows the process structure of a selectable process.
  1029.  
  1030.    * Show CLI
  1031.  
  1032.      shows the cli structure of a selectable process.
  1033.  
  1034.    * Show Hunk
  1035.  
  1036.      shows the hunks of a selectable process.
  1037.  
  1038.    * Send Task Signal
  1039.  
  1040.      sends a signal to a selectable task.
  1041.  
  1042.    * Set Task Priority
  1043.  
  1044.      sets a priority of a selectable task.
  1045.  
  1046.    * Refresh Code Cache
  1047.  
  1048.      refreshes the Code Cache.
  1049.  
  1050.    * Refresh Data Cache
  1051.  
  1052.      refreshes the Data Cache
  1053.  
  1054. Usage of BDebug
  1055. ***************
  1056.  
  1057. The FPU Window
  1058. ==============
  1059.  
  1060. FPU Window
  1061. ----------
  1062.  
  1063.    The FPU Window shows the FPU register FP0 to FP7 in the 96Bit
  1064. Extended format and the registers FPCR, FPSR and FPIAR in hexadecimal.
  1065. You can only open this window if a FPU is available.
  1066.  
  1067.      Register Window Layout
  1068.  
  1069.                            FP0=FloatingPoint
  1070.  
  1071.                            FP1=FloatingPoint
  1072.  
  1073.                            FP2=FloatingPoint
  1074.  
  1075.                            FP3=FloatingPoint
  1076.  
  1077.                            FP4=FloatingPoint
  1078.  
  1079.                            FP5=FloatingPoint
  1080.  
  1081.                            FP6=FloatingPoint
  1082.  
  1083.                            FP7=FloatingPoint
  1084.  
  1085.                       FPCR=xxxxxxxx FPSR=xxxxxxxx
  1086.  
  1087.                             FPIAR=xxxxxxxx
  1088.  
  1089. Local Menus
  1090. -----------
  1091.  
  1092.    * Close Window
  1093.  
  1094.      closes the window.
  1095.  
  1096. Usage of BDebug
  1097. ***************
  1098.  
  1099. The Disassembler Window
  1100. =======================
  1101.  
  1102. Disassembler window
  1103. -------------------
  1104.  
  1105.    The `DissWindow' shows the memory contents in assembler mnemonics.
  1106. The address of the window's view can be absolute or relative.  In
  1107. absolut mode, the window shows the contents of a fixed address,
  1108. indicated by the window title `No Link'.  In relative mode the window
  1109. is connected to a register causing the window to update when the the
  1110. register value changes.  This is indicated by the window title which
  1111. reads `Link to *', where * represents the register name.  The PC is
  1112. shown by the colour pen 2.  If the linked register value is outside of
  1113. the window's view area the whole contents of the window will be
  1114. refreshed.  You can change size of the window and scroll through the
  1115. memory area by using the cursors.  In the title you see an ID-String
  1116. with the format `\#x.y' where `X' represents the `REGWindow' number and
  1117. `y' the number of the `MemWindow'.  Doubleclicking a line of the window
  1118. sets or remove a breakpoint.  You can disable this function in the
  1119. configuration.
  1120.  
  1121. Local Menus
  1122. -----------
  1123.  
  1124.    * Close Window
  1125.  
  1126.      closes the window.
  1127.  
  1128.    * Shrink Window
  1129.  
  1130.      shrinks the window.
  1131.  
  1132.    * Expand Window
  1133.  
  1134.      expands the window to screen size.
  1135.  
  1136.    * Link to Register
  1137.  
  1138.      links the window with a register.  If you enter the string `NO' it
  1139.      switches to absolute mode.
  1140.  
  1141.    * Change address
  1142.  
  1143.      changes the view address of the window.
  1144.  
  1145.    * Clear address
  1146.  
  1147.      resets the view address of the window.
  1148.  
  1149.    * Refresh Window
  1150.  
  1151.      refreshes the window.
  1152.  
  1153.    * .W Branches
  1154.  
  1155.      activates and disactivates the output of the old branch width size.
  1156.  
  1157.    * Neg. Offsets
  1158.  
  1159.      activates and disactivates the output of negative values in
  1160.      indirect address modes with offset.
  1161.  
  1162.    * Neg. Data
  1163.  
  1164.      activates and disactivates the output of negative values in direct
  1165.      address mode.
  1166.  
  1167.    * Opcode Data
  1168.  
  1169.      activates and disactivates the additional output of the command
  1170.      bytes.
  1171.  
  1172.    * Auto Refresh
  1173.  
  1174.      activates and disactivates the global refresh of the window after
  1175.      each step.
  1176.  
  1177.    * Symbols
  1178.  
  1179.      activates and disactivates the symbol output in the window.
  1180.  
  1181.    * Show Lib Call
  1182.  
  1183.      activates and disactivates the symbolic output of library
  1184.      functions so all library functions that are defined in the
  1185.      configuration file `<BarflyPath>/Barfly/BARFLY.FD' are recognized.
  1186.  
  1187.    * Guess Lib Call
  1188.  
  1189.      activates and disactivates the guessing of function call names.
  1190.      This only works in connection with the option `Show Lib Call'.
  1191.      Unfortunately you can't expect that the function names always fit
  1192.      because the library base register A6 can change until the program
  1193.      counter meets the function.
  1194.  
  1195.    * Mark Block End
  1196.  
  1197.      activates and deactivates marking after the instruction `JMP',
  1198.      `BRA', `RTS', `RTE', `RTD' and `RTR' to make program blocks more
  1199.      visible.
  1200.  
  1201.    * Set/Clear Breakpoint
  1202.  
  1203.      sets/removes a breakpoint on the first entry in the window.
  1204.      Breakpoints are shown by changing the pen from colour 1 to colour
  1205.      3 and the char `>' at the beginning of a line.
  1206.  
  1207.    * Pick/Clear Breakpoint
  1208.  
  1209.      sets/removes a breakpoint through a symbol list.
  1210.  
  1211.    * Disassemble to File
  1212.  
  1213.      disassembles a memory area into a file.
  1214.  
  1215. Usage of BDebug
  1216. ***************
  1217.  
  1218. The Memory Window
  1219. =================
  1220.  
  1221. Memory window
  1222. -------------
  1223.  
  1224.    The `MemWindow' shows the memory contents hexadecimal and in
  1225. ascii.You can change size of the window and scroll through the memory
  1226. area whith the cursor keys.  In the title you see an ID-String with the
  1227. format `\#x.y' where `X' represents the `REGWindow' number and `y' the
  1228. number of the `MemWindow'.
  1229.  
  1230. Local Menus
  1231. -----------
  1232.  
  1233.    * Close Window
  1234.  
  1235.      closes the window.
  1236.  
  1237.    * Shrink Window
  1238.  
  1239.      shrinks the window.
  1240.  
  1241.    * Expand Window
  1242.  
  1243.      expands the window to screen size.
  1244.  
  1245.    * Link to Register
  1246.  
  1247.      links the window with a register.  If you enter the string `NO' it
  1248.      switches to absolute mode.
  1249.  
  1250.    * Change address
  1251.  
  1252.      changes the view address of the window.
  1253.  
  1254.    * Clear address
  1255.  
  1256.      resets the view address of the window.
  1257.  
  1258.    * Refresh Window
  1259.  
  1260.      refreshes the window.
  1261.  
  1262.    * Memory Offset Step
  1263.  
  1264.      defines the data format in the window.  The following options can
  1265.      be selected: `None', `Byte', `Word' and `Long'.
  1266.  
  1267.    * Edit
  1268.  
  1269.      activates edit mode of the `MemWindow'.  In edit mode you can
  1270.      switch between hex and ascii input by the key `RETURN'. With `ESC'
  1271.      you can leave edit mode. Only the cursor right and left are
  1272.      changed to the normal.  With these both keys you can access each
  1273.      Byte.  In edit mode you can't change the size of the window.
  1274.  
  1275.    * Copy
  1276.  
  1277.      copies a memory area into another memory area.  The function uses
  1278.      `CopyMem' so it doesn't handle memory areas that overlap.
  1279.  
  1280.    * Fill
  1281.  
  1282.      fills a memory area with a value of a certain data-width.
  1283.  
  1284.    * Compare
  1285.  
  1286.      compares a memory area with another memory area.
  1287.  
  1288.    * Search
  1289.  
  1290.      searches a value of a certain data-width in a memory area.  If the
  1291.      value is found, the address and the value are displayed and you
  1292.      can goon with `Search Next' to find the next address.
  1293.  
  1294.    * Search Next
  1295.  
  1296.      Search the next value. Look at `Search'
  1297.  
  1298.    * Pred
  1299.  
  1300.      sets the address of the window tn the preceding entry of the list.
  1301.      If the node points on an odd, illegal or NULL address the command
  1302.      has no effect.  The next node is equal to `LN_PRED', the second
  1303.      longword of the memory view.
  1304.  
  1305.    * Succ
  1306.  
  1307.      sets the address of the window to the next entry of the list.  If
  1308.      the node points on an odd, illegal or NULL address the command has
  1309.      no effect.  The next node is equal to `LN_SUCC', the first longword
  1310.      of the memory view.
  1311.  
  1312. Usage of BDebug
  1313. ***************
  1314.  
  1315. The Copper Window
  1316. =================
  1317.  
  1318. CopperWindow
  1319. ------------
  1320.  
  1321.    The `CopperWindow' shows the memory contents as copper commands.
  1322. The window is sizeable, and you can use the cursor keys to scroll
  1323. through the memry area.  In the title you see an ID-String with the
  1324. format `\#x.y' where `X' represents the `REGWindow' number and `y' the
  1325. number of the `CoppWindow'.
  1326.  
  1327. Local Menus
  1328. -----------
  1329.  
  1330.    * Close Window
  1331.  
  1332.      closes the window.
  1333.  
  1334.    * Shrink Window
  1335.  
  1336.      shrinks the window.
  1337.  
  1338.    * Expand Window
  1339.  
  1340.      expands the window to screen size.
  1341.  
  1342.    * Link to Register
  1343.  
  1344.      links the window with a register.  If you enter the string `NO' it
  1345.      switches to absolute mode.
  1346.  
  1347.    * Change address
  1348.  
  1349.      changes the view address of the window.
  1350.  
  1351.    * Clear address
  1352.  
  1353.      resets the view address of the window.
  1354.  
  1355.    * Refresh Window
  1356.  
  1357.      refreshes the window.
  1358.  
  1359.    * Goto Into List
  1360.  
  1361.      sets the window list on the standard copperlist
  1362.      `GfxBase->gb_copinit'.
  1363.  
  1364. Usage of BDebug
  1365. ***************
  1366.  
  1367. The Structure Window
  1368. ====================
  1369.  
  1370. StructWindow
  1371. ------------
  1372.  
  1373.    opens window which can be connected with a structure.  You can use
  1374. new structure entries by expanding the the
  1375. `<BarflyPath>/Barfly/Barfly.Include' file or loading a new custom file.
  1376. By a doubleclick on a structure window entry you can cause several
  1377. actions depending on the datatype.  Every datatype is connected with an
  1378. action that is normally started automaticlly.  With the configuration
  1379. command `NoAutoStructAction' you can change this behaviour so that an
  1380. action type requester is opened.
  1381.  
  1382.    The following datatypes are available.
  1383.  
  1384.    * APTR opens a MemWindow.
  1385.  
  1386.    * CSTR shows a string.
  1387.  
  1388.    * BPTR opens a MemWindow at the address BPTR*4.
  1389.  
  1390.    * BSTR shows a string at the address (BPTR*4)+1
  1391.  
  1392.    * CPTR opens a DissWindow.
  1393.  
  1394.    * FPTR opens a DissWindow.
  1395.  
  1396.    * BYTE doesn't cause an action.
  1397.  
  1398.    * WORD doesn't cause an action.
  1399.  
  1400.    * LONG doesn't cause an action.
  1401.  
  1402.    * FLOAT doesn't cause an action.
  1403.  
  1404.    * DOUBLE doesn't cause an action.
  1405.  
  1406.    * EXTENDED doesn't cause an action.
  1407.  
  1408.    * RPTR doesn't cause an action.
  1409.  
  1410.    The following action types are available.
  1411.  
  1412.    * MemWindow opens a MemWindow.
  1413.  
  1414.    * DissWindow opens a DissWindow.
  1415.  
  1416.    * CoppWindow opens a CoppWindow.
  1417.  
  1418.    * StructWindow opens a StructWindow.
  1419.  
  1420.    * NewStruct sets a new structure.
  1421.  
  1422. Structure Macro Fileformat
  1423. --------------------------
  1424.  
  1425.    This section describes the file format of structure macros.  In the
  1426. beginning you define the root directory entries with the first Macro
  1427. `Menudir'.  The first parameter is the name of the entry, then the
  1428. address of the parent directory and then the address of the
  1429. subdirectory.  In the root directory the parent address is obviously
  1430. NULL.  The last entry of the directory is defined by the Macro
  1431. `MENUDIREND'.
  1432.  
  1433.      `Label                   ListViewMacro           Link'
  1434.      RootDir:
  1435.                              .
  1436.                              .
  1437.                              MENUDIR                 exec,0,Exec_Dir
  1438.                              .
  1439.                              .
  1440.      MYCUSTOMENTRY:
  1441.                              MENUDIREND              CUSTOM,0,0
  1442.  
  1443.    The design of a subdirectory only differs from the root directory
  1444. entries only by a parent directory address.
  1445.  
  1446.      `Label                   ListViewMacro           Link'
  1447.      Exec_Dir:
  1448.                              .
  1449.                              .
  1450.                              MENUDIR                 nodes.i,RootDir,Nodes_Dir
  1451.                              .
  1452.                              .
  1453.                              MENUDIREND              tasks.i,RootDir,Tasks_Dir
  1454.  
  1455.    to define the structure directory entries you have to use `MENUITEM'
  1456. and `MENUITEMEND'.  The first parameter in the Item Macros is the name
  1457. of the entry and also the name of the structure.  The second parameter
  1458. defines the address of the parent directory.
  1459.  
  1460.      `Label                   ListViewMacro           Link'
  1461.                              .
  1462.                              .
  1463.      Nodes_Dir:
  1464.                              MENUITEM                LN,Exec_Dir
  1465.                              .
  1466.                              .
  1467.                              MENUITEMEND
  1468.  
  1469.    To define a structure you can use the normal assembler syntax that
  1470. you probably have to adjust to your custom needs. For example you can
  1471. tell BDebug more informations about the datatype an entry represents.
  1472. By redefining `APTR' to a `CSTR' you can tell the Debugger that the
  1473. entry is a stringpointer.  Another example is defining that `APTR'
  1474. points to a structure by `APTR LN_SUCC,Node'.
  1475.  
  1476.      `Label                   IncludeTypeMacro        Name,Link'
  1477.      LN_Struct:
  1478.                              STRUCTUREB              LN,0
  1479.                              APTR                    LN_SUCC,LN
  1480.                              APTR                    LN_PRED,LN
  1481.                              UBYTE                   LN_TYPE
  1482.                              BYTE                    LN_PRI
  1483.                              CCSTR                   LN_NAME
  1484.                              LABEL                   LN_SIZE
  1485.  
  1486. Local Menus
  1487. -----------
  1488.  
  1489.    * Close Window
  1490.  
  1491.      closes the window.
  1492.  
  1493.    * Shrink Window
  1494.  
  1495.      shrinks the window.
  1496.  
  1497.    * Expand Window
  1498.  
  1499.      expands the window to screen size.
  1500.  
  1501.    * Link to Register
  1502.  
  1503.      links the window with a register.  If you enter the string `NO' it
  1504.      switches to absolute mode.
  1505.  
  1506.    * Change address
  1507.  
  1508.      changes the view address of the window.
  1509.  
  1510.    * Clear address
  1511.  
  1512.      resets the view address of the window.
  1513.  
  1514.    * Refresh Window
  1515.  
  1516.      refreshes the window.
  1517.  
  1518.    * Load Custom Struct
  1519.  
  1520.      loads additional structure files. The new structure entries are
  1521.      placed in the `CUSTOM' directory.  The format of custom structure
  1522.      files is equal to the file `BARFLY.INCLUDE'.
  1523.  
  1524.    * Select Structure
  1525.  
  1526.      opens the structure include directory requester where you can
  1527.      select the needed structure.  The parent gadget is placed in the
  1528.      upper border.
  1529.  
  1530.    * Goto Sysbase...
  1531.  
  1532.      sets the window address on the ExecBase.
  1533.  
  1534.    * Goto Gfxbase...
  1535.  
  1536.      sets the window address on the GFXBase.
  1537.  
  1538.    * Save Window....
  1539.  
  1540.      saves the contents of the window in a file.
  1541.  
  1542.    * Full Address
  1543.  
  1544.      this switch decides whether the `StructWindow' also shows the
  1545.      address of the entries.
  1546.  
  1547.    * Offset Address
  1548.  
  1549.      this switch decides wheather the `StructWindow' also shows the
  1550.      offset of the entries.
  1551.  
  1552.    * Pred
  1553.  
  1554.      sets the address of the window on the preceding entry of the list.
  1555.      If the node points on an odd, illegal or NULL address the command
  1556.      has no effect.  The next node is equal to `LN_PRED', the second
  1557.      longword of the memory view.
  1558.  
  1559.    * Succ
  1560.  
  1561.      sets the address of the window on the next entry of the list.  If
  1562.      the node points on an odd, illegal or NULL address the command has
  1563.      no effect.  The next node is equal to `LN_SUCC', the first longword
  1564.      of the memory view.
  1565.  
  1566. Usage of BDebug
  1567. ***************
  1568.  
  1569. The Structure Window
  1570. ====================
  1571.  
  1572. Source window
  1573. -------------
  1574.  
  1575.    The `SourceWindow' shows the source line that belongs to the window
  1576. address. If the program file doesn't have the needed debug informations
  1577. the `Source window' can't be opened. If the address points to an area
  1578. with no relevant debug information, for example the Kickstart or beyond
  1579. the program hunks, all you see is a small message.
  1580.  
  1581. Local Menus
  1582. -----------
  1583.  
  1584.    * Close Window
  1585.  
  1586.      closes the window.
  1587.  
  1588.    * Shrink Window
  1589.  
  1590.      shrinks the window.
  1591.  
  1592.    * Expand Window
  1593.  
  1594.      expands the window to screen size.
  1595.  
  1596.    * Link to Register
  1597.  
  1598.      links the window with a register.  If you enter the string `NO' it
  1599.      switches to absolute mode.
  1600.  
  1601.    * Change address
  1602.  
  1603.      changes the view address of the window.
  1604.  
  1605.    * Clear address
  1606.  
  1607.      resets the view address of the window.
  1608.  
  1609.    * Refresh Window
  1610.  
  1611.      refreshes the window.
  1612.  
  1613.    * Set Breakpoint
  1614.  
  1615.      sets a breakpoint on the active line.
  1616.  
  1617.    * Show HunkInfo
  1618.  
  1619.      shows the hunk of the current source line.
  1620.  
  1621. Usage of BDebug
  1622. ***************
  1623.  
  1624. The Snoop Window
  1625. ================
  1626.  
  1627. Snoop Window
  1628. ------------
  1629.  
  1630.    The `SnoopWindow' snoops the task's allocations.
  1631.  
  1632. Local Menus
  1633. -----------
  1634.  
  1635.    * Close Window
  1636.  
  1637.      closes the window.
  1638.  
  1639.    * Shrink Window
  1640.  
  1641.      shrinks the window.
  1642.  
  1643.    * Expand Window
  1644.  
  1645.      expands the window to screen size.
  1646.  
  1647.    * Refresh Window
  1648.  
  1649.      refreshes the window.
  1650.  
  1651.    * Auto Refresh
  1652.  
  1653.      activates/deactivates display refresh by an allocation.
  1654.  
  1655.    * Snoop Memory
  1656.  
  1657.      activates/deactivates snooping.
  1658.  
  1659.    * Snoop Mask
  1660.  
  1661.      sets the allocation filter mask.  If the Mask is set to , only
  1662.      allocations with the size 20 are recorded. Default -1.
  1663.  
  1664.    * Snoop Max Entries
  1665.  
  1666.      sets the maximal recordable snoop entries.
  1667.  
  1668. Usage of BDebug
  1669. ***************
  1670.  
  1671. The Breakpoint Window
  1672. =====================
  1673.  
  1674. Breakpoint window
  1675. -----------------
  1676.  
  1677.    The `BreakWindow' handles all breakpoints and contains the functions
  1678. that are needed with breakpoints.  In general, breakpoints are
  1679. addresses in the program where the task should be stopped.  The
  1680. breakpoints are handled globally so they aren't deleted when close the
  1681. window.
  1682.  
  1683. Local Menus
  1684. -----------
  1685.  
  1686.    * Toggle
  1687.  
  1688.      activates and deactivates all breakpoints.
  1689.  
  1690.    * All
  1691.  
  1692.      selects all breakpoints.
  1693.  
  1694.    * Clear
  1695.  
  1696.      unselects all breakpoints.
  1697.  
  1698.    * On
  1699.  
  1700.      activates all selected breakpoints.
  1701.  
  1702.    * Off
  1703.  
  1704.      deactivates all selected breakpoints.
  1705.  
  1706.    * Hit
  1707.  
  1708.      defines how often a breakpoint must be encountered before the
  1709.      program stops. Default is 1.
  1710.  
  1711.    * ?
  1712.  
  1713.      shows the hunk where the breakpoint is located and also shows if
  1714.      the breakpoint is equal to a symbol.
  1715.  
  1716.    * Input
  1717.  
  1718.      sets and removes a breakpoint.
  1719.  
  1720.    * Pick
  1721.  
  1722.      sets and removes a breakpoint using the symbol list.
  1723.  
  1724.    * Delete
  1725.  
  1726.      removes all selected breakpoint.
  1727.  
  1728.    * Goto
  1729.  
  1730.      opens a DissWindow for each selected breakpoint.
  1731.  
  1732.    * Run
  1733.  
  1734.      runs the program until the PC encounters a selected breakpoint.
  1735.  
  1736. Usage of BDebug
  1737. ***************
  1738.  
  1739. The Watchpoint Window
  1740. =====================
  1741.  
  1742. Watchpoint window
  1743. -----------------
  1744.  
  1745.    The `Watchwindow' allows to set breakpoints that aren't depending on
  1746. a certain PC address but on other conditions.  Every watchpoint has a
  1747. condition, data width and can have one of 3 different watchpoints
  1748. states.  The `Memory' watchpoint compares the saved contents of the
  1749. address with the current contents and dependent on the condition the
  1750. program is stopped or not.  The `Register' watchpoint compares the
  1751. saved contents of a register with the current contents and dependent on
  1752. the condition the program is stopped or not.  The `Argument' watchpoint
  1753. compares the saved value of an argument with the current contents and
  1754. dependent on the condition the program is stopped or not.  The last
  1755. watchpoint type is the most powerful because it can simulate the first
  1756. two types with the cost of a slowdown.  The use of watchpoints is very
  1757. time consuming because the whole program is run in single step mode.
  1758. In order to use watchpoi you have to run the task with `Run Watched
  1759. Task'.
  1760.  
  1761.      If an error occurs in the exception handler during the evaluation
  1762.      of a dynamic arugment, the screen flashes.
  1763.  
  1764.  
  1765. Local Menus
  1766. -----------
  1767.  
  1768.    * Toggle
  1769.  
  1770.      activates and deactivates all watchpoints.
  1771.  
  1772.    * All
  1773.  
  1774.      selects all watchpoints.
  1775.  
  1776.    * Clear
  1777.  
  1778.      unselects all watchpoints.
  1779.  
  1780.    * On
  1781.  
  1782.      activates all selected watchpoints.
  1783.  
  1784.    * Off
  1785.  
  1786.      deactivates all selected watchpoints.
  1787.  
  1788.    * Add
  1789.  
  1790.      opens a requester where the parameters for a watchpoint have to be
  1791.      adjusted and adds the new watchpoint to the list.  You can change
  1792.      the parameters simply by doubeclicking on a watchpoint.
  1793.  
  1794.    * Refresh
  1795.  
  1796.      refreshes the watchpoint arguments.
  1797.  
  1798.    * Check
  1799.  
  1800.      checks all selected watchpoints.
  1801.  
  1802.    * Delete
  1803.  
  1804.      removes all selected watchpoints.
  1805.  
  1806. Usage of BDebug
  1807. ***************
  1808.  
  1809. The Checksum Window
  1810. ===================
  1811.  
  1812. Checksum Window
  1813. ---------------
  1814.  
  1815.    The `ChecksumWindow' controls all checksum areas that are controlled
  1816. each time the task stops.  Helpful to find illegal random writes bugs.
  1817. The checkpoints are controled globally so they aren't deleted when you
  1818. close the window.
  1819.  
  1820. Local Menus
  1821. -----------
  1822.  
  1823.    * Toggle
  1824.  
  1825.      activates or deactivates all checksum areas.
  1826.  
  1827.    * All
  1828.  
  1829.      selects all checksum areas.
  1830.  
  1831.    * Clear
  1832.  
  1833.      unselects all checksum areas.
  1834.  
  1835.    * On
  1836.  
  1837.      activates all selected checksum areas.
  1838.  
  1839.    * Off
  1840.  
  1841.      deactivates all selected checksum areas.
  1842.  
  1843.    * Address
  1844.  
  1845.      adds a checksum area into the list.
  1846.  
  1847.    * Hunk
  1848.  
  1849.      adds a hunk of the current process into the checksum area list.
  1850.  
  1851.    * Task
  1852.  
  1853.      adds a hunk of selectable process into the checksum area list.
  1854.  
  1855.    * Refresh
  1856.  
  1857.      calculate a new checksum for all selected areas.
  1858.  
  1859.    * Delete
  1860.  
  1861.      removes all selected checksum areas.
  1862.  
  1863.    * Check
  1864.  
  1865.      checks all areas for checksum errors.
  1866.  
  1867. Usage of BDebug
  1868. ***************
  1869.  
  1870. Requester Arguments
  1871. ===================
  1872.  
  1873. Argument Structur
  1874. -----------------
  1875.  
  1876.    An argument can use absolut values, symbols and registers as
  1877. operands and the operators +,-,*,/,|,!,&,<<,>>,~.  Additionally to the
  1878. normal symbols, some special symbols are available.
  1879.  
  1880.    * By {Argument}.[b,w,l] you can read from a memory address, that is
  1881.      defined by the argument. An error is indicated if you specify an
  1882.      illegal address with isn't defined in the legal memory space.
  1883.  
  1884.    * \#d?  represents the address of the `Disswindows' with the ID ?
  1885.  
  1886.    * \#m?  represents the address of the `Memwindows' with the ID ?
  1887.  
  1888.    * \#c?  represents the address of the `Coppwindows' with the ID ?
  1889.  
  1890.    * \#h?  represents the address of the hunk ?.  Helpful for Enforcer
  1891.      and CyberGuard Hunk:Offset output
  1892.  
  1893.    * \#ea? represents the address of the EA with the number ?.  Check
  1894.      Register Window.
  1895.  
  1896.    * \#em? represents the contents where the address EA number ?
  1897.      points to.  Check Register Window. If the address EA is illegal an
  1898.      error is shown.
  1899.  
  1900.    * \#ls  represents the start address of a loaded binary file.
  1901.  
  1902.    * \#le  represents the end address of a loaded binary file.
  1903.  
  1904.    * \#ll  represents the length address of a loaded binary file.
  1905.  
  1906.    * \#p   represents the start address of the programs.  Only true for
  1907.      a loaded program.
  1908.  
  1909.    If you have the following Enforcer or CyberGuard hit output `Hunk
  1910. 0:$11c' you can calculate the address by entering the argument #h0+$11c.
  1911.  
  1912. Usage of BDebug
  1913. ***************
  1914.  
  1915. Technical Informations
  1916. ======================
  1917.  
  1918. Exceptions
  1919. ----------
  1920.  
  1921.    The Debugger can catch all exceptions if the system is still working.
  1922. If an exception is caused, the traphandler catches the exception and
  1923. tells the Debugger what went on so it can react on the exception.  If
  1924. the exception wasn't caused by the Debugger, the type and the possible
  1925. reason for the exception is shown.  The `Return-address' of the
  1926. debugged task points on an internal `ILLEGAL'. If the processor
  1927. encounters this `ILLEGAL' the task is closed and all windows are
  1928. removed.  You shouldn't step over this `ILLEGAL' because it increases
  1929. the possibility of a system crash.  If a task is caught by `Debug Next
  1930. Task' and notices a custom `finalPC' routine in the `Addtask()'
  1931. function, the `Return-address' isn't set on the internal `ILLEGAL'
  1932. cleanup function because the `finalPC' pointer is sometimes used for
  1933. parsing an argument.  In this case the Debugger notices that the task
  1934. ends by using the `RemTask()' function.
  1935.  
  1936.      If the task changes the `Return-address' the Debugger tries to
  1937.      determine the taskend by `RemTask'.
  1938.  
  1939.  
  1940. Exception Handler
  1941. -----------------
  1942.  
  1943.    Every task has a pointer in its task structure that points to its
  1944. exception handler, named `TC_TRAPCODE'.  When you load a program
  1945. through the Debugger, the Debugger's standard exception handler is
  1946. installed. It works basicly the same for `Catch Next Task' and `Debug
  1947. Task'.  The only difference is the `Debug Crashed Task' mode where the
  1948. Debugger sets a special catch exception handler in each task that isn't
  1949. controlled by the Debugger.  When an exception occurs and the
  1950. Debugger's exception handler is called the Debugger first checks if it
  1951. knows the task that caused it.  If this is not the case something
  1952. seriously is broken and the Deadend Alert 35000000 will be popped up.
  1953. If all goes well the registers are saved, the Debugger task gets a
  1954. message and the exception handler waits for a message by the Debugger
  1955. to go on.  When the Debugger gets the message it causes the appropriate
  1956. function. For example refreshing the windows.  If the Debugger gets a
  1957. step command it sends the exception handler the appropriate message and
  1958. the handler does a step.
  1959.  
  1960. Debug Informations
  1961. ------------------
  1962.  
  1963.    Currently the following formats are supported.
  1964.  
  1965.    * BASM Specialformat This format allows the Debugger to decide if
  1966.      the code is in the Mainpart, Includes or in a Macro.
  1967.  
  1968.    * SAS D1 This format only allows a Source-Code connection.  It
  1969.      doesn't support local variables, Structures and Macros.
  1970.  
  1971.    * GCC STABS This format is very powerful and offers all a
  1972.      source-level Debugger needs.  Unfortunately the Debugger only
  1973.      supports a simple Source-Code connection at the moment.  It's
  1974.      planned to support more in the future.
  1975.  
  1976. GCC Compiler and BDebug
  1977. -----------------------
  1978.  
  1979.    Unfortunately you can't debug programs that are using the current
  1980. `ixemul.library' because in Openlibrary() initroutine the Task field
  1981. TC_TRAPCODE is changed.  Hopefully there'll be soon an `ixemul.library'
  1982. available that doesn't change the traphandler.  If you're using GCC
  1983. with the link lib `gerlib' that is available on Aminet FTP Servers you
  1984. shouldn't experience any problems with BDebug.
  1985.  
  1986. Usage of BDebug
  1987. ***************
  1988.  
  1989. Configuration
  1990. =============
  1991.  
  1992.    The default configuration file is named `BDEBUG.Config' and is
  1993. located in the directory `<BarflyPath>/' or `s:Barfly/'.  Obviously
  1994. it's not optimal to be forced to use the same config file for different
  1995. programs. Therefore you can also specify a local config file with
  1996. program name and the suffix `.BDebug'.
  1997.  
  1998. ToolTypes
  1999. ---------
  2000.  
  2001.    The following tooltypes are supported to activate the basic
  2002. functions of the commandwindow.
  2003.  
  2004.    * CatchNextTask
  2005.  
  2006.    * CatchCrashedTask
  2007.  
  2008.    * CatchEnforcerHit
  2009.  
  2010. Barfly.FD
  2011. ---------
  2012.  
  2013.    Following steps are necessary to create a new `Barfly.FD' file with
  2014. new library functions.  First the assign `FD:' must point to the
  2015. directory containing the FD files that should be included in the new
  2016. `Barfly.FD'.  Make sure that every FD file contains the Library,
  2017. Resource and Device name in the first line in following format: `*
  2018. "foobar.libary"'.  If necessary, add the name yourself, so that a
  2019. correct FD database can be build up.  If you're more experienced with
  2020. FD files, you can yourself add new entries to the `Barfly.FD' file. The
  2021. layout of the `Barfly.FD' file pretty obvious.
  2022.  
  2023. Configuration Commands
  2024. ----------------------
  2025.  
  2026. Register window
  2027. ---------------
  2028.  
  2029. RegWindow=x/y/width/height/register
  2030. ...................................
  2031.  
  2032.    This command defines the position of a `REGWindow'.
  2033.  
  2034. RegFlags=flag[|flags...]
  2035. ........................
  2036.  
  2037.    This command defines certain flags in the `REGWindows'.
  2038.  
  2039.    * AUTOVIEWREFRESH
  2040.  
  2041.    * SYMBOLS
  2042.  
  2043.    * STACKCHECK
  2044.  
  2045.    * NOBIGVIEW
  2046.  
  2047. FPU Window
  2048. ----------
  2049.  
  2050. FpuWindow=x/y/width/height/register
  2051. ...................................
  2052.  
  2053.    This command defines the position of a `FPUWindow'.
  2054.  
  2055. OpenFPUWindows=Count
  2056. ....................
  2057.  
  2058.    This command tells the Debugger to open a `FPUWindow'.
  2059.  
  2060. Disassembler window
  2061. -------------------
  2062.  
  2063. DissWindow=x/y/width/height/register
  2064. ....................................
  2065.  
  2066.    This command defines the position,the dimension and linked register
  2067. of the `DissWindow'.
  2068.  
  2069.    Example: DISSWINDOW=0/0/300/100/PC
  2070.  
  2071. DissFlags=flag[|flags...]
  2072. .........................
  2073.  
  2074.    This command defines certain flags in the `DISSWindow'.
  2075.  
  2076.    * AUTOREFRESH
  2077.  
  2078.    * SHOWLIB
  2079.  
  2080.    * GUESSLIB
  2081.  
  2082.    * SHOWEA
  2083.  
  2084.    * WORDBRANCHES
  2085.  
  2086.    * NEGOFFSETS
  2087.  
  2088.    * NEGDI
  2089.  
  2090.    * OPCODEDATA
  2091.  
  2092.    * BLANKAFTERJMPBRA
  2093.  
  2094. OpenDissWindows=Count
  2095. .....................
  2096.  
  2097.    This command tells the Debugger to open a number of `DissWindows'.
  2098.  
  2099. Memory window
  2100. -------------
  2101.  
  2102. MemWindow=x/y/width/height/register
  2103. ...................................
  2104.  
  2105.    This command defines the position, the dimension and linked register
  2106. of the `MemWindow'.
  2107.  
  2108.    Example: MEMWINDOW=0/0/300/100/A0
  2109.  
  2110. OpenMemWindows=Count
  2111. ....................
  2112.  
  2113.    This command tells the Debugger to open a number of `MemWindows'.
  2114.  
  2115. MemoryOffsetStep=Count
  2116. ......................
  2117.  
  2118.    This command defines the Offset-Step of the `MemWindows'.
  2119.  
  2120.    * 0 no Space
  2121.  
  2122.    * 1 Space after each Byte.
  2123.  
  2124.    * 2 Space after each Word.
  2125.  
  2126.    * 4 Space after each Longword.
  2127.  
  2128. Copper window
  2129. -------------
  2130.  
  2131. CoppWindow=x/y/width/height/register
  2132. ....................................
  2133.  
  2134.    This command defines the position, the dimension and linked register
  2135. of the `CoppWindow'.
  2136.  
  2137.    Example: COPPWINDOW=0/0/300/100/A0
  2138.  
  2139. OpenCoppWindows=Count
  2140. .....................
  2141.  
  2142.    This command tells the Debugger to open a number of `CoppWindows'.
  2143.  
  2144. StructWindow
  2145. ------------
  2146.  
  2147. StructWindow=x/y/width/height/register
  2148. ......................................
  2149.  
  2150.    This command defines the position, the dimension and linked register
  2151. of the `StructWindow'.
  2152.  
  2153.    Example: StructWINDOW=0/0/300/100/A0
  2154.  
  2155. StructFlags=flag[|flags...]
  2156. ...........................
  2157.  
  2158.    This command defines certain flags for the `StructWindow'
  2159.  
  2160.    * AUTOREFRESH
  2161.  
  2162.    * ADDRESSFORMAT
  2163.  
  2164.    * OFFSETFORMAT
  2165.  
  2166.    * NEWWINDOW
  2167.  
  2168. OpenStructWindows=Count
  2169. .......................
  2170.  
  2171.    This command tells the Debugger to open a number of `StructWindows'.
  2172.  
  2173. Source window
  2174. -------------
  2175.  
  2176. SourceWindow=x/y/width/height/register
  2177. ......................................
  2178.  
  2179.    This command defines the position, the dimension and linked register
  2180. of the `SourceWindow'.
  2181.  
  2182.    Example: SOURCEWINDOW=0/0/300/100/A0
  2183.  
  2184. OpenSourceWindows=Count
  2185. .......................
  2186.  
  2187.    This command tells the Debugger to open a number of `SourceWindows'.
  2188.  
  2189. Breakpoint window
  2190. -----------------
  2191.  
  2192. BreakWindow=x/y/width/height
  2193. ............................
  2194.  
  2195.    This command defines the position of a `BreakPointWindow'.
  2196.  
  2197. OpenBreakWindows=Count
  2198. ......................
  2199.  
  2200.    This command tells the Debugger to open a `BreakPointWindow'.
  2201.  
  2202. Watchpoint window
  2203. -----------------
  2204.  
  2205. WatchWindow=x/y/width/height
  2206. ............................
  2207.  
  2208.    This command defines the position of a `WatchpoinzWindow'.
  2209.  
  2210. OpenWatchWindows=Count
  2211. ......................
  2212.  
  2213.    This command tells the Debugger to open a `WatchPointWindow'.
  2214.  
  2215. Checksum window
  2216. ---------------
  2217.  
  2218. ChecksumWindow=x/y/width/height
  2219. ...............................
  2220.  
  2221.    This command defines the position of a `ChecksumWindow'.
  2222.  
  2223. ChecksumWindows=Count
  2224. .....................
  2225.  
  2226.    This command tells the Debugger to open a `ChecksumWindow'.
  2227.  
  2228. SnoopMemory window
  2229. ------------------
  2230.  
  2231. SnoopMemWindow=x/y/width/height/register
  2232. ........................................
  2233.  
  2234.    This command defines the position of a `SnoopMemWindow'.
  2235.  
  2236. OpenSnoopMemWindow=Count
  2237. ........................
  2238.  
  2239.    This command tells the Debugger to open a `SnoopMemWindow'.
  2240.  
  2241. SnoopMask=Mask
  2242. ..............
  2243.  
  2244.    This command defines the snoop mask. The mask defines the length of
  2245. memory blocks that should be recorded.  Default is -1 so everything is
  2246. recorded.
  2247.  
  2248. SnoopMax=Count
  2249. ..............
  2250.  
  2251.    This command defines the count of snoop entries.  Default is 100.
  2252.  
  2253. HistoryEntrys=Count
  2254. ...................
  2255.  
  2256.    This command defines the count of history entries.  Default is 5.
  2257.  
  2258. Information Windows
  2259. -------------------
  2260.  
  2261. GlobalViewWindow=x/y/width/height
  2262. .................................
  2263.  
  2264.    This command defines the position and dimensions of a standard
  2265. information window. For example the Library Window belongs to this
  2266. group.
  2267.  
  2268.    Example: GLOBALVIEWWINDOW=0/0/300/100
  2269. GLOBALVIEWWINDOW=0/200/300/100
  2270.  
  2271. Other Windows
  2272. -------------
  2273.  
  2274. CommandWindow=x/y/width/height
  2275. ..............................
  2276.  
  2277.    This command defines the position of the small `CommandWindow'.
  2278. This command has no function in local configuration files.
  2279.  
  2280. FileShell=<Window Specifikation>
  2281. ................................
  2282.  
  2283.    This command defines the shell that is opened with the loaded
  2284. program. You should always open the shell on the Debugger's Public
  2285. Screen. The shell parameters are the same you know from the CLI.
  2286.  
  2287. Misc
  2288. ----
  2289.  
  2290. TaskStack=Count
  2291. ...............
  2292.  
  2293.    This command defines the stack of the loaded program.  Defaullt are
  2294. 4096 Bytes.
  2295.  
  2296. Priority=Count
  2297. ..............
  2298.  
  2299.    This command defines the Debugger's priority.
  2300.  
  2301. SetBreak=Argument
  2302. .................
  2303.  
  2304.    This command can be used to define a list of breakpoints that are
  2305. set before the program is started.  This is useful to pass the module
  2306. `Main.c' for example.  If no breakpoints are defined or if a parsing
  2307. problem occurs the standard breakpoint ( the first program instruction
  2308. ) is set.
  2309.  
  2310.    * SETBREAK=_main    ; SAS C Main Program Start
  2311.  
  2312.    * SETBREAK=_main    ; GCC C Main Program Start
  2313.  
  2314.    * SETBREAK=@main   ; DICE C Main Program Start
  2315.  
  2316.    * SETBREAK=!    ; Programstart(Default)
  2317.  
  2318. ClickBreak=State
  2319. ................
  2320.  
  2321.    This command can be used to define the action of the DissWindow on a
  2322. doubleclick.
  2323.  
  2324. `State=0'
  2325.      No Action(Default).
  2326.  
  2327. `State=1'
  2328.      Set/Clear Breakpoint and pop up a Requester for a Set.
  2329.  
  2330. `State=2'
  2331.      Set/Clear Breakpoint.
  2332.  
  2333. ShowMem=Start:End
  2334. .................
  2335.  
  2336.    defines the address areas that are legal to the Debugger so you can
  2337. look at address areas that are not in the memorylist or in the rom.
  2338. Illegal address areas are shown with `*' in the windows.  You should
  2339. `never' define the custom chip areas as legal because a read access on
  2340. a writeonly register can cause a deadly crash.
  2341.  
  2342.    Example: SHOWMEM=$e80000:$f00000          defines the Zorro 2 area
  2343. as free.
  2344.  
  2345.      By this command you can overrule the internal Enforcer or
  2346.      CyberGuard legal memory areas so you should be free of hits.
  2347.  
  2348.  
  2349. DefCommand=Key,Qualifier[|Qualifier...],Function
  2350. ................................................
  2351.  
  2352.    This commands allows to connect menu functions with key sequences.
  2353. Because of the object-oriented concept of the Debugger that allows
  2354. multiple instances of objects it's not easy to decide what object is
  2355. meant.  Therefore if the object is active it's used and if no object of
  2356. this type is active the first entry the object-type list is used.  As
  2357. the key parameter every Rawkey can be used with the exception of `TAB'
  2358. and the functionkeys that are used internally.  The key is searched
  2359. first in the local and then in the global configuration.
  2360.  
  2361.    As qualifiers you can use the following keys.
  2362.  
  2363.    * LSHIFT
  2364.  
  2365.    * RSHIFT
  2366.  
  2367.    * CAPSLOCK
  2368.  
  2369.    * CTRL
  2370.  
  2371.    * LALT
  2372.  
  2373.    * RALT
  2374.  
  2375.    * LCOMMAND
  2376.  
  2377.    * RCOMMAND
  2378.  
  2379.           Bespiel:      DEFCOMMAND=$15,CTRL,"Step 1 Position"
  2380.  
  2381.      Defines CTRL-Z as Step 1 Position
  2382.  
  2383. AutoDocDir=<Path>
  2384. .................
  2385.  
  2386.    This command sets the path for the autodocs directory.
  2387.  
  2388. AutoDocAlias=Library,File
  2389. .........................
  2390.  
  2391.    This command sets an alias for Libraries, Devices or Resources to
  2392. define the connected Autodocs file.  There's no other way because it's
  2393. impossible to build the autodocs file by knowing the library name.
  2394.  
  2395. ArexxPath=<rx-path>
  2396. ...................
  2397.  
  2398.    This command sets the Arexx-Script Start-Command.  In a normal
  2399. system the path should be <sys:Rexxc/rx>.
  2400.  
  2401. ArexxInput=<File>
  2402. .................
  2403.  
  2404.    This command sets the Arexx-Command Input-File.  If you don't
  2405. specify the file, NIL: is used.
  2406.  
  2407. ArexxOutput=<File>
  2408. ..................
  2409.  
  2410.    This command sets the Arexx-Command Output-File.  If you don't
  2411. specify the file, NIL: is used.
  2412.  
  2413. ArexxCommand=[1...10],<Pfad>
  2414. ............................
  2415.  
  2416.    This command sets the 10 entries in the Arexx-Menu.  You specify the
  2417. number and the path of the Arexx-Script.
  2418.  
  2419.    ArexxCommand=1,"Rexx:Example.rexx"
  2420.  
  2421. ExecuteCommand=<File>
  2422. .....................
  2423.  
  2424.    this command can set up a list of programs that should be run before
  2425. the debugged program's task is started.  This parameter only works with
  2426. programs which are loaded by the Debugger. You also have to make sure
  2427. that the loaded programs have to `end' otherwise the task can't be
  2428. started.  For example you could use this command to set breakpoints
  2429. with Arexx-Scripts.
  2430.  
  2431. LoadInclude
  2432. ...........
  2433.  
  2434.    tells the Debugger to load the structure information file
  2435. `Barfly.Include'.
  2436.  
  2437. AddStructFile=Filename
  2438. ......................
  2439.  
  2440.    tells the Debugger to load a custom structure information file and
  2441. adds it into the CUSTOM/ subtree.
  2442.  
  2443. ClicktoFront
  2444. ............
  2445.  
  2446.    activates the Debugger's own `ClicktoFront' handler.  This function
  2447. should only be used if you don't use an own `Commodity' for this task.
  2448.  
  2449. CenterWindow
  2450. ............
  2451.  
  2452.    activates centering mode for all stringrequester windows.
  2453.  
  2454. ScreenInFront
  2455. .............
  2456.  
  2457.    activates `ScreenToFront' mode that pops the screen to front after
  2458. every trace operation.
  2459.  
  2460. OpenScreen[=width,height,depth,mode]
  2461. ....................................
  2462.  
  2463.    tells the Debugger to open its own screen.  If you don't enter
  2464. dimension parameters the wb screen is cloned. For the mode string you
  2465. string you can see in `Prefs/ScreenMode' requester.  This command has
  2466. no function in local configuration files.
  2467.  
  2468.    OPENSCREEN=1448,560,2,PAL:HighRes Interlace
  2469.  
  2470. OpenPubScreen=Name
  2471. ..................
  2472.  
  2473.    tells the Debugger to open on the Pubscreen with the specified name.
  2474. This command has no function in local configuration files.
  2475.  
  2476. ScreenFont=fontname/Height
  2477. ..........................
  2478.  
  2479.    defines a font for a Debugger screen.  This command has no function
  2480. in local configuration files.
  2481.  
  2482. QuietException=Exception Nummer
  2483. ...............................
  2484.  
  2485.    masks off certain exceptions for the exception requester so that
  2486. only a `DisplayBeep' is caused instead of a textrequest.  With the
  2487. value -1 you can mask off every exception and for example with the
  2488. value 4 you mask off the `Illegal' exception.
  2489.  
  2490. DisableXPointer
  2491. ...............
  2492.  
  2493.    deactivate the Wait-Pointer.
  2494.  
  2495. TraceBreak
  2496. ..........
  2497.  
  2498.    tells the Debugger to use breakpoints in the `Subroutine' Traces
  2499. instead of single steps.  The advantage is a speed up and the
  2500. disadvantage is that you can cause crashes while you step through
  2501. resident/reentry code.
  2502.  
  2503. CrashedTask
  2504. ...........
  2505.  
  2506.    activates `CatchCrashedTask' mode.
  2507.  
  2508. CatchEnforcerHit
  2509. ................
  2510.  
  2511.    activates `CatchEnforcerHit' mode.
  2512.  
  2513. DoNotCacheFullFile
  2514. ..................
  2515.  
  2516.    tells the Debugger not to cache program files while reading the
  2517. Symbol/Debug informations to save memory.  Obviously the parsing speed
  2518. will decrease.
  2519.  
  2520. DoNotPopPathRequest
  2521. ...................
  2522.  
  2523.    tells the Debugger to ignore errors from opening source files and
  2524. not to open a path requester.
  2525.  
  2526. NoAutoStructAction
  2527. ..................
  2528.  
  2529.    tells the Debugger to open a type-requester by an action in the
  2530. Structure Window.
  2531.  
  2532. NoBreakpointErrors
  2533. ..................
  2534.  
  2535.    tells the Debugger to ignore SETBREAK= errors that cause the
  2536. Debugger to always set an error on the program start.
  2537.  
  2538. Usage of BDebug
  2539. ***************
  2540.  
  2541. Arexx
  2542. =====
  2543.  
  2544. Commands
  2545. --------
  2546.  
  2547. SIMPLEREQUEST "
  2548. ...............
  2549.  
  2550.    * RC: -
  2551.  
  2552.    * result: 'OK'
  2553.  
  2554. TWOGADREQUEST "
  2555. ...............
  2556.  
  2557.    * RC: -
  2558.  
  2559.    * result: 'OK','FALSE'
  2560.  
  2561. TRIGADREQUEST "
  2562. ...............
  2563.  
  2564.    * RC: -
  2565.  
  2566.    * result: 'OK','FALSE','RESUME'
  2567.  
  2568. NEXT_ROOTWINDOW
  2569. ...............
  2570.  
  2571.    * RC: -
  2572.  
  2573.    * result: 'OK','FALSE'
  2574.  
  2575. NEXT_SUBWINDOW
  2576. ..............
  2577.  
  2578.    * RC: -
  2579.  
  2580.    * result: 'OK','FALSE'
  2581.  
  2582. FIRST_DISSWINDOW
  2583. ................
  2584.  
  2585.    * RC: -
  2586.  
  2587.    * result: 'OK','FALSE'
  2588.  
  2589. FIRST_MEMWINDOW
  2590. ...............
  2591.  
  2592.    * RC: -
  2593.  
  2594.    * result: 'OK','FALSE'
  2595.  
  2596. FIRST_COPPWINDOW
  2597. ................
  2598.  
  2599.    * RC: -
  2600.  
  2601.    * result: 'OK','FALSE'
  2602.  
  2603. FIRST_FPUWINDOW
  2604. ...............
  2605.  
  2606.    * RC: -
  2607.  
  2608.    * result: 'OK','FALSE'
  2609.  
  2610. FIRST_BREAKPOINTWINDOW
  2611. ......................
  2612.  
  2613.    * RC: -
  2614.  
  2615.    * result: 'OK','FALSE'
  2616.  
  2617. FIRST_STRUCTWINDOW
  2618. ..................
  2619.  
  2620.    * RC: -
  2621.  
  2622.    * result: 'OK','FALSE'
  2623.  
  2624. FIRST_SOURCEWINDOW
  2625. ..................
  2626.  
  2627.    * RC: -
  2628.  
  2629.    * result: 'OK','FALSE'
  2630.  
  2631. FIRST_SNOOPWINDOW
  2632. .................
  2633.  
  2634.    * RC: -
  2635.  
  2636.    * result: 'OK','FALSE'
  2637.  
  2638. FIRST_WATCHWINDOW
  2639. .................
  2640.  
  2641.    * RC: -
  2642.  
  2643.    * result: 'OK','FALSE'
  2644.  
  2645. ACTIVATE_ROOTWINDOW
  2646. ...................
  2647.  
  2648.    * RC: -
  2649.  
  2650.    * result: 'OK','FALSE'
  2651.  
  2652. ACTIVATE_SUBWINDOW
  2653. ..................
  2654.  
  2655.    * RC: -
  2656.  
  2657.    * result: 'OK','FALSE'
  2658.  
  2659. OPEN_DISSWINDOW '@REG' | 'Argument'
  2660. ...................................
  2661.  
  2662.    * RC: -
  2663.  
  2664.    * result: -
  2665.  
  2666. OPEN_MEMWINDOW '@REG' | 'Argument'
  2667. ..................................
  2668.  
  2669.    * RC: -
  2670.  
  2671.    * result: -
  2672.  
  2673. OPEN_COPPWINDOW '@REG' | 'Argument'
  2674. ...................................
  2675.  
  2676.    * RC: -
  2677.  
  2678.    * result: -
  2679.  
  2680. OPEN_SOURCEWINDOW '@REG' | 'Argument'
  2681. .....................................
  2682.  
  2683.    * RC: -
  2684.  
  2685.    * result: -
  2686.  
  2687. OPEN_STRUCTWINDOW '@REG' | 'Argument'
  2688. .....................................
  2689.  
  2690.    * RC: -
  2691.  
  2692.    * result: -
  2693.  
  2694. OPEN_BREAKPOINTWINDOW
  2695. .....................
  2696.  
  2697.    * RC: -
  2698.  
  2699.    * result: -
  2700.  
  2701. OPEN_FPUWINDOW
  2702. ..............
  2703.  
  2704.    * RC: -
  2705.  
  2706.    * result: -
  2707.  
  2708. OPEN_SNOOPMEMORYWINDOW
  2709. ......................
  2710.  
  2711.    * RC: -
  2712.  
  2713.    * result: -
  2714.  
  2715. DOMENU 'Menu-String'
  2716. ....................
  2717.  
  2718.    * RC: -
  2719.  
  2720.    * result: -
  2721.  
  2722. SET_BREAKPOINT 'Argument'
  2723. .........................
  2724.  
  2725.    * RC: -
  2726.  
  2727.    * result: 'OK','FALSE'
  2728.  
  2729. CLEAR_ICACHE 'Address,Length'
  2730. .............................
  2731.  
  2732.    * RC: -
  2733.  
  2734.    * result: 'OK'
  2735.  
  2736. CLEAR_ICACHE 'Address,Length'
  2737. .............................
  2738.  
  2739.    * RC: -
  2740.  
  2741.    * result: 'OK'
  2742.  
  2743. GOTO_ADDRESS 'Address'
  2744. ......................
  2745.  
  2746.    * RC: -
  2747.  
  2748.    * result: 'OK','FALSE'
  2749.  
  2750. CLEAR_ADDRESS
  2751. .............
  2752.  
  2753.    * RC: -
  2754.  
  2755.    * result: 'OK','FALSE'
  2756.  
  2757. LINK_REGISTER 'Register'
  2758. ........................
  2759.  
  2760.    * RC: -
  2761.  
  2762.    * result: 'OK','FALSE'
  2763.  
  2764. SET_REGISTER 'Register,Value'
  2765. .............................
  2766.  
  2767.    * RC: -
  2768.  
  2769.    * result: 'OK','FALSE'
  2770.  
  2771. Read_Byte 'Address'
  2772. ...................
  2773.  
  2774.    RC    : 0=Ok    Result: Result-String
  2775.  
  2776. Read_Word 'Address'
  2777. ...................
  2778.  
  2779.    RC    : 0=Ok    Result: Result-String
  2780.  
  2781. Read_Long 'Address'
  2782. ...................
  2783.  
  2784.    RC    : 0=Ok    Result: Result-String
  2785.  
  2786. Write_Byte 'Address,Value'
  2787. ..........................
  2788.  
  2789.    RC    : 0=Ok
  2790.  
  2791. Write_Word 'Address,Value'
  2792. ..........................
  2793.  
  2794.    RC    : 0=Ok
  2795.  
  2796. Write_Long 'Address,Value'
  2797. ..........................
  2798.  
  2799.    RC    : 0=Ok
  2800.  
  2801. ASL_FileRequester_Save
  2802. ......................
  2803.  
  2804.    RC    : 0=Ok    Result: Filepath-String
  2805.  
  2806. ASL_FileRequester_Load
  2807. ......................
  2808.  
  2809.    RC    : 0=Ok    Result: Filepath-String
  2810.  
  2811. IS_ADDRESS_LEGAL 'Address'
  2812. ..........................
  2813.  
  2814.    * RC: -
  2815.  
  2816.    * result: 'OK','FALSE'
  2817.  
  2818. LOAD_BINARY 'Name,Destination,Length'
  2819. .....................................
  2820.  
  2821. SAVE_BINARY 'Name,Source,Length'
  2822. ................................
  2823.  
  2824. Usage of BDebug
  2825. ***************
  2826.  
  2827. How to use BDebug ?
  2828. ===================
  2829.  
  2830. Trouble Shooting
  2831. ----------------
  2832.  
  2833.    First you should be sure that all necessary configurations file have
  2834. been installed because without `Barfly.FD' file you don't see any
  2835. function names in the disassembler window; and without `Barfly.Include'
  2836. the `StructWindow' is unusable.  Are these preconditions fullfilled you
  2837. should analyse the problem and anticipate how the Debugger can be used.
  2838. Because the debugging of programs depends heavily on the situation i
  2839. can only list some general points.  The reality probably looks
  2840. different... as always:-)
  2841.  
  2842.    Point of departure:
  2843.  
  2844.    * Program from the CLI
  2845.  
  2846.         * 1 Task
  2847.  
  2848.           The program can be started by `bdebug Program [Argument]' or
  2849.           can be loaded the command window `Debug File'.  By this
  2850.           method all symbol and debug files are loaded.  If the
  2851.           Debugger can't find a source file you can add additional
  2852.           paths if you haven't disabled this function.  The standard
  2853.           breakpoint is the first command in the program.  Sometimes
  2854.           this is inconvenient, and you may want to set a different
  2855.           start breakpoint for example to jump over the CStartup code
  2856.           or to set it tn an important program position.
  2857.  
  2858.         * Creates further Tasks
  2859.  
  2860.           In this case you should be sure how you want to catch the next
  2861.           Task. You could catch the Task by `Next Task' or compile the
  2862.           program with an `illegal' in the task and catch it with
  2863.           `Crashed Task'.  After you caught the task you probably would
  2864.           like to use see symbols and debug source.  These informations
  2865.           can be loaded afterwards by using `Load Symbols'.
  2866.  
  2867.    * Program from the WB
  2868.  
  2869.      In this case you should use `Next Task' and then catch the task
  2870.      `WBL'. Afterwards you have to activate `Next Task' again and run
  2871.      `WBL'. You could also use the `illegal' strategy.  After the right
  2872.      task was caught you can load the symbols again.
  2873.  
  2874.    * Is it a Handler, Filesystem or something similar.
  2875.  
  2876.      In this case you should use the `illegal' strategy and catch the
  2877.      task by `Crashed Task'.  An alternative method would be to catch
  2878.      the waiting task with `Debug Task' and wait as long as the task
  2879.      gets woken up by a signal.
  2880.  
  2881.    After you've taken the first hurdles in taking control over the task,
  2882. you should think about how the problem looks like and where it could be
  2883. located.
  2884.  
  2885.    Problem Type:
  2886.  
  2887.    * Enforcer/CyberGuard
  2888.  
  2889.      If an Enforcer or CyberGuard hit is caused, these programs output
  2890.      the hit's program address and most of the time the hunk offset as
  2891.      well.  You can now directly jump to the address by entering the
  2892.      address in the DissWindow by `Change Address' or you open a
  2893.      HunkWindow, doubleclick on the hunk where the hit is located and
  2894.      then enter the offset returned by Enforcer or CyberGuard.  The
  2895.      Debugger itself can also automaticlly stop a debugged program if a
  2896.      hit happens.
  2897.  
  2898.    * Mungwall
  2899.  
  2900.      These hits aren't as easy to find as Enforcer or CyberGuard hits
  2901.      because Mungwall hits aren't shown when the problem happened but
  2902.      only after a `FreeMem'.  In this case you should remember the
  2903.      memoryblock where it happened and determine where the responsible
  2904.      AllocMem is located in the program, so you get an overview in what
  2905.      area the problem is caused.  Now you should open a MemWindow that
  2906.      points to this certain memory area and step through the program
  2907.      and look if something changes the mungwall borders in the
  2908.      MemWindow.  Mungwall borders are before and after the allocated
  2909.      memory area.  If you're more experienced you could also use the
  2910.      WatchpointWindow and set a watchpoint on the certain memory block.
  2911.  
  2912.    * Crash
  2913.  
  2914.      If it's just an ordinary crash the error should be pretty easy to
  2915.      find by single stepping through the responsible code area.  If
  2916.      it's a random crash you should try `Crashed Task' and hope that
  2917.      the task can be caught.  After the task got caught you should
  2918.      check the instructions that caused the crash. If the PC points to
  2919.      data fields that don't look like real code the PC is probably set
  2920.      wrong by a stack cleanup error.  In this case you should check if
  2921.      the next addresses on the stack point to legal program code.
  2922.  
  2923.    * Side effects and mysterious bugs
  2924.  
  2925.      These bugs are the worst to find and there's no general strategy
  2926.      how to find them. In such cases only intuition and patience can
  2927.      help.
  2928.  
  2929. Problems that can happen
  2930. ------------------------
  2931.  
  2932.    * Why does the Debugger react so slow on keyboard commands that
  2933.      control the tracing ?
  2934.  
  2935.      This happens if you debug a task with a higher priority than the
  2936.      Debugger's priority.  For example. DOS-Handler.  Workaround is to
  2937.      increase the priority of the Debugger.
  2938.  
  2939.    * Why do filerequesters block the Debugger.
  2940.  
  2941.      This happens when you debug a handler, because the filerequester
  2942.      normally tests every handler with a IsFilesystem(). When you debug
  2943.      a handler it can't reply the IsFilesystem packet and therefore the
  2944.      filerequester is busy.
  2945.  
  2946.    * If you debug the following program on a 68040 with 68040.library
  2947.      or 68060.library the instruction `rts' is run if you cause a
  2948.      Single-Step on the instruction `fetox'.  Because this command
  2949.      isn't implemented in the 68040 and 68060 it has to be emulated. It
  2950.      seems to forget the tracebit.
  2951.  
  2952.               mc68040
  2953.               fmove.x    #1.3,fp0
  2954.               fmove.x    #255,fp1
  2955.               fetox.x    fp0,fp1
  2956.               rts
  2957.  
  2958.    * If a program doesn't return from a DOS function, check whether you
  2959.      accidently entered a char in shell window.
  2960.  
  2961.                                BAsm 1.0
  2962.  
  2963.                     A cli/arexx controled Assembler
  2964.  
  2965.                   Copyright (c) 1989-98 Ralph Schmidt
  2966.  
  2967.                              - Shareware -
  2968.  
  2969. The Assembler
  2970. *************
  2971.  
  2972.    The assembler understands the commands and addressmodes from the
  2973. 68000 through the 68060 and both the Floating-Point Units, 68881 and
  2974. 68882.  It supports only the 68851 MMU commands, which are also
  2975. supported by the 68030.  Since the new V2.0 it also supports from
  2976. PPC603 to PPC7500.  The assembler achieves it's speed by translating
  2977. the source in a single pass, followed by a backpatch phase which
  2978. corrects all unresolved references.
  2979.  
  2980. Syntax
  2981. ======
  2982.  
  2983. Comments
  2984. --------
  2985.  
  2986.    A comment can start in several different ways.  In a pure comment it
  2987. starts either with a ; or *.  A comment can only be started after an
  2988. assembler command or symbol with a ; if an assembler command or symbol
  2989. exists within that line.
  2990.  
  2991.          ;A comment
  2992.      *A comment
  2993.          move.l a0,a0    ;A comment
  2994.  
  2995. Opcode/Instructions arrangement
  2996. -------------------------------
  2997.  
  2998.    `[label[:]] [opcode] [operand[, operand[, operand...]]]]]'
  2999.  
  3000.    * Opcodes
  3001.  
  3002.      An Opcode can be a Motorola Mnemonic, an assembler command, or a
  3003.      Macro call.
  3004.  
  3005.    * Operations
  3006.  
  3007.      In a Motorola mnemonic operands are based on legal addressmoes; in
  3008.      assembler privat instructions the parameters depend on the
  3009.      instruction.
  3010.  
  3011. Symbol structure
  3012. ----------------
  3013.  
  3014.    A symbol can represent the following types:
  3015.  
  3016.    * Value
  3017.  
  3018.    * Program Counter
  3019.  
  3020.    * Register
  3021.  
  3022.    * Register List
  3023.  
  3024.    * Macro
  3025.  
  3026.    Symbols can only be defined once. The exceptions are local labels
  3027. and symbols defined by Set.
  3028.  
  3029.                      Structure rules for Symbols.
  3030.  
  3031.    * The first letter of a symbol can be one of the following: a...z,
  3032.      A...Z,_, @,. and \.
  3033.  
  3034.    * From the second letter on, the symbol can contain the following
  3035.      letters: a...z, A...Z, 0...9, _,@ and ..
  3036.  
  3037.    * If a symbol consists of only numbers and ends with $, then it is a
  3038.      numerical local label.
  3039.  
  3040.    * A symbol is ended by an illegal letter.
  3041.  
  3042.    * If a symbol begins with a . or \, then it is a local label.
  3043.  
  3044.    * A macro symbol should not contain a ..
  3045.  
  3046.    * To avoid a conflict, a symbol should not end with .b, .w or .l.
  3047.  
  3048.  
  3049.      ThisIsALabel              ;That is a normal label
  3050.      ThisIsALabel1.loop:       ;That is a normal label
  3051.      This@_Is_@A_@Label
  3052.      1$:                       ;That is a numerical local label
  3053.      .ThisIsALabel             ;That is a local label
  3054.      .ThisIsALael1:            ;That is a local label
  3055.      \ThisIsALabel.loop:       ;That is a local label
  3056.      ThisIsASymbol=10
  3057.      ThisIsASymbol = 10
  3058.      ThisIsASymbol equ 10
  3059.  
  3060. The relative label
  3061. ------------------
  3062.  
  3063.    This symbol represents an offset to the start of a program.
  3064.  
  3065.  
  3066.      label
  3067.      label:
  3068.      label    nop
  3069.      label: nop
  3070.  
  3071. The local Label
  3072. ---------------
  3073.  
  3074.    A local label is only valid between two normal relative labels, thus
  3075. you cannot reference local labels outside of that scope.  Otherwise it
  3076. works similar as a normal label.  There are 2 different prefixes that
  3077. introduce a local label: . and \ that define 2 different local labels.
  3078. A special case is the Backward Reference Label that is introduced with
  3079. ... It doesn't depend on a certain define area between normal labels
  3080. thus you can only access the symbol if it were defined earlier.
  3081.  
  3082.  
  3083.      ..:
  3084.      label_0:
  3085.      .local:
  3086.       bra.s .local
  3087.      label_1:
  3088.      .local:
  3089.       bra.s \local
  3090.      \local:
  3091.       nop
  3092.      label_end:
  3093.      ..:
  3094.       dbra d0,..
  3095.      ..:
  3096.       dbra d1,..
  3097.      ..Hello:
  3098.       dbra d1,..Hello
  3099.  
  3100. The local numerical label
  3101. -------------------------
  3102.  
  3103.    Addionally to the non-numerical local label there are also the
  3104. numerical labels which are based of 4 digits with the postfix $.  BASM
  3105. handles the number as a hash key with the consequence that there's no
  3106. difference between 001$ and 1$.
  3107.  
  3108.  
  3109.  
  3110.      label_0:
  3111.      123$:    nop
  3112.      label_1:
  3113.      123$:    nop
  3114.  
  3115. The absolute Symbol
  3116. -------------------
  3117.  
  3118.    The absolute symbol is defined by a direct value initializing that
  3119. is initiated by =, equ or set.  If you define a symbol by set you can
  3120. change it as often as needed.
  3121.  
  3122.  
  3123.  
  3124.      value1=2
  3125.      value2 equ value1*2
  3126.      value3 set value2
  3127.  
  3128. The 68k Register Symbol
  3129. -----------------------
  3130.  
  3131.    The register symbol is defined by `equr' or `fequr' that is used for
  3132. FPU registers.
  3133.  
  3134.  
  3135.  
  3136.      Ptr    equr    a1
  3137.      PI    fequr    fp2
  3138.       move.l   (Ptr),d0   ;move.l  (a1),d0
  3139.       fmove.x  PI,fp0     ;fmove.x fp2,fp0
  3140.  
  3141. The PPC Register Symbol
  3142. -----------------------
  3143.  
  3144.    The register symbol is defined by `equrp' or `fequrp' that is used
  3145. for FPU registers.
  3146.  
  3147.  
  3148.  
  3149.      Ptr    equrp    3
  3150.      PI    fequrp    4
  3151.      Vector    vequrp    5
  3152.          lwz    0,0(Ptr)
  3153.          fadd    0,4,PI
  3154.          lvewx    Vector,3,4
  3155.  
  3156. The 68k Register List Symbol
  3157. ----------------------------
  3158.  
  3159.    The register list symbol is defined by `reg' and represents the
  3160. register mask for `Movem' and `fmovem'.  You must not mix FPU and
  3161. Integer registers with each other in a register list.
  3162.  
  3163.  
  3164.      mask    reg    d0/d2/d4-d7/a0-a4/a6-a7
  3165.      mask1    reg    d0-a6
  3166.      mask2    reg    d0-6
  3167.      fmask    reg    fp0-fp2/fp4-fp5
  3168.  
  3169. The Macro Symbol
  3170. ----------------
  3171.  
  3172.    By using the command `macro' or `cmacro' after the symbol, the
  3173. symbol is defined as a macro.  The macro block is terminated by the
  3174. command endm.  The Macro cmacro is case-insensitive and therefore
  3175. useful to emulate commands that are missing from the core.
  3176.  
  3177.  
  3178.  
  3179.  
  3180.      Symbol[:] macro
  3181.      .
  3182.      .
  3183.      Symbol[:] endm
  3184.  
  3185. Datatypes
  3186. ---------
  3187.  
  3188.    The assembler understands 3 distinct datatypes.
  3189.  
  3190.    * 32Bit Integer
  3191.  
  3192.    * 96Bit Extended Floating Point
  3193.  
  3194.    * 96Bit Packed Binary Floating Point
  3195.  
  3196.    At the moment only integer datatypes are supported in arithmetic
  3197. arguments so you can only use the FPU datatypes as constants.
  3198.  
  3199.      +-------------+--------------------+
  3200.      | Format      | Representation     |
  3201.      +-------------+--------------------+
  3202.      +-------------+--------------------+
  3203.      | Decimal     | 1024               |
  3204.      +-------------+--------------------+
  3205.      | Hexadecimal | $400               |
  3206.      +-------------+--------------------+
  3207.      | Binary      | %10000000000       |
  3208.      +-------------+--------------------+
  3209.      | Ascii       | "OK", 'OK' or `OK` |
  3210.      +-------------+--------------------+
  3211.  
  3212.    Furthermore you can use symbols or the character `*' that represents
  3213. the program counter in arguments.  There are limitation in the use of
  3214. symbols in arguments.  For example you can only add or subtract
  3215. constants from an external label, Floatingpoint Values can only be used
  3216. as simple constants,...  By the postfix `k' after decimal value the
  3217. value is multply by $1000.
  3218.  
  3219.                         `Floating Point Format'
  3220.  
  3221.      +-------------+-------------------------------------+
  3222.      | Format      | Representation                      |
  3223.      +-------------+-------------------------------------+
  3224.      +-------------+-------------------------------------+
  3225.      | Extended    | '[+,-]3. 145637848298628[e[+,-]123] |
  3226.      +-------------+-------------------------------------+
  3227.      | Packed      | ''[+,-]3. 145637848298628[e[+,-]123]|
  3228.      +-------------+-------------------------------------+
  3229.  
  3230. Datatype Conversion
  3231. -------------------
  3232.  
  3233.    All commands are performed with these 3 datatypes and then converted
  3234. into the required datatype.  For example a 32Bit integer can be
  3235. converted into 16Bit and 8 Bit; an extended floating point into a
  3236. double or single floating point.  Floating point datatypes are rounded
  3237. by a convertation.  If a rouding error occurs the parser returns with
  3238. an error.
  3239.  
  3240. Datatype Format
  3241. ---------------
  3242.  
  3243.                       Internal Datatype Structure
  3244.  
  3245.    * Integer
  3246.  
  3247.      +--------+---------+
  3248.      | Bit 31 | 30..0   |
  3249.      +--------+---------+
  3250.      +--------+---------+
  3251.      |    S   | Integer |
  3252.      +--------+---------+
  3253.  
  3254.    * Single Floating Point
  3255.  
  3256.      +--------+-----------------+------------+
  3257.      | Bit 31 | Bits 30..23     | Bits 22..0 |
  3258.      +--------+-----------------+------------+
  3259.      +--------+-----------------+------------+
  3260.      |  Sign  | Biased Exponent |  Fraction  |
  3261.      +--------+-----------------+------------+
  3262.  
  3263.    * Double Floating Point
  3264.  
  3265.      +--------+-----------------+------------+
  3266.      | Bit 63 | Bits 62..52     | Bits 51..0 |
  3267.      +--------+-----------------+------------+
  3268.      +--------+-----------------+------------+
  3269.      |  Sign  | Biased Exponent |  Fraction  |
  3270.      +--------+-----------------+------------+
  3271.  
  3272.    * Extended Floating Point
  3273.  
  3274.      +--------+-----------------+------------+
  3275.      | Bit 95 | Bits 94..80     | Bits 62..0 |
  3276.      +--------+-----------------+------------+
  3277.      +--------+-----------------+------------+
  3278.      |  Sign  | Biased Exponent |  Mantisse  |
  3279.      +--------+-----------------+------------+
  3280.  
  3281.    * Packed Binary Floating Point
  3282.  
  3283.      +------+------+------+------+------+------+------+------+
  3284.      | MEYY | EXP2 | EXP1 | EXP0 | EXP3 | 0000 | 0000 | M016 |
  3285.      +------+------+------+------+------+------+------+------+
  3286.      | M015 | M014 | M013 | M012 | M011 | M010 | M009 | M008 |
  3287.      +------+------+------+------+------+------+------+------+
  3288.      | M007 | M006 | M005 | M004 | M003 | M002 | M001 | M000 |
  3289.      +------+------+------+------+------+------+------+------+
  3290.  
  3291.    * M is the sign (+ or -) of the fraction
  3292.  
  3293.    * E is the sign (+ or -) of the exponent
  3294.  
  3295.    * Y are the internal flags for infinity and NAN
  3296.  
  3297.    * E002-000 are the numbers of the exponent from 2 to 0, EXP3 is used
  3298.      internally.
  3299.  
  3300.    * M016-000 are the numbers of the fraction from 16 to 0. Each number
  3301.      lies in the range from 0 to 9..
  3302.  
  3303. Operations
  3304. ----------
  3305.  
  3306. Operators
  3307. ---------
  3308.  
  3309.      +----------+-------------------------------+
  3310.      | Operator | Function                      |
  3311.      +----------+-------------------------------+
  3312.      +----------+-------------------------------+
  3313.      |   `+'    | 32Bit signed Addition         |
  3314.      +----------+-------------------------------+
  3315.      |   `-'    | 32Bit signed Subtraction      |
  3316.      +----------+-------------------------------+
  3317.      |   `*'    | 32Bit signed Multiplication   |
  3318.      +----------+-------------------------------+
  3319.      |   `/'    | 32Bit signed Division         |
  3320.      +----------+-------------------------------+
  3321.      |   '|'    | 32Bit Or                      |
  3322.      +----------+-------------------------------+
  3323.      |   `!'    | 32Bit Or                      |
  3324.      +----------+-------------------------------+
  3325.      |   `&'    | 32Bit And                     |
  3326.      +----------+-------------------------------+
  3327.      |   `^'    | 32Bit Eor                     |
  3328.      +----------+-------------------------------+
  3329.      |   `<<'   | logic 32Bit Shift to the left |
  3330.      +----------+-------------------------------+
  3331.      |   `>>'   | logic 32Bit Shift to the right|
  3332.      +----------+-------------------------------+
  3333.      |   `~'    | 32Bit Not                     |
  3334.      +----------+-------------------------------+
  3335.  
  3336.      Basm cares for the operator priorities but be careful while
  3337.      porting Seka Sources because Seka doesn't care for the priorities.
  3338.  
  3339. Functions
  3340. ---------
  3341.  
  3342.    The following functions are supported.
  3343.  
  3344.    * _bitnum(Argument) calculates the bit number of the argument. If
  3345.      this is impossible an error occurs.
  3346.  
  3347.    * _bitfield(Argument) calculates the bit mask of the argument. If
  3348.      this is impossible an error occurs.
  3349.  
  3350.    * _extb(Argument) equal to the 680xx command extb
  3351.  
  3352.    * _extw(Argument) equal to the 680xx command extw
  3353.  
  3354.    * _min(Argument[,Argument,...]) calculate the minimum of the
  3355.      argument.
  3356.  
  3357.    * _max(Argument[,Argument,...]) calculate the maximum of the
  3358.      argument.
  3359.  
  3360. PPC Elf Reloc Types
  3361. -------------------
  3362.  
  3363.        addis    3,0,a@ha ;@ha means the UPPER word of the symbol value
  3364. a is written there ;the loader/linker also deals with the sign problem
  3365. if the LOWER ;word is negative.      addi    3,3,a@l ;@l means the UPPER word
  3366. of the symbol value a is written there
  3367.  
  3368. Assembler Commands
  3369. ==================
  3370.  
  3371. Hunk/Link Commands
  3372. ------------------
  3373.  
  3374. [Label] section Name[,Typ[,[RelocModus,Memtyp]
  3375. ..............................................
  3376.  
  3377.    defines a new logical unit so that the DOS-Loader has the
  3378. opportuntity to place smaller hunks into free memory blocks.  Another
  3379. use for this command is to set different memory types for the hunk to
  3380. load gfx data into the chipmem.  If you don't specify the section type
  3381. it assumes "",Code,Public.
  3382.  
  3383.    * Name = Hunkname
  3384.  
  3385.    * Hunk type
  3386.  
  3387.     `CODE'
  3388.           starts a code segment.
  3389.  
  3390.     `DATA'
  3391.           starts a data segment.
  3392.  
  3393.     `BSS'
  3394.           starts an undefined data segment.
  3395.  
  3396.     `DEBUG'
  3397.           starts a custom debug segment.
  3398.  
  3399.     `CUSTOM'
  3400.           starts a Custom-Hunk area.
  3401.  
  3402.    * Reloc-Mode defines the width of the hunk relocation. Default 32Bit
  3403.  
  3404.     `RELOC16'
  3405.           sets the reloc width to 16bit.(V37)
  3406.  
  3407.     `RELOC32'
  3408.           sets the reloc width to 32bit.(Default)
  3409.  
  3410.    * Memtype defines the memory attributes of the hunk.  If you add a
  3411.      `_p', `_c', or `_f' upon the type parameter, you cannot use more
  3412.      memtypes.The memtype `DEBUG' does not allow memory attribute
  3413.      suffixes.
  3414.  
  3415.     `PUBLIC'
  3416.           loads the hunk into the memory with the highest priority.
  3417.           Code Suffix _p.
  3418.  
  3419.     `CHIP'
  3420.           loads the hunk into chip memory. Code Suffix _c.
  3421.  
  3422.     `FAST'
  3423.           loads the hunk into fast memory. Code Suffix _f.
  3424.  
  3425.     `ADVISORY'
  3426.           ignores the hunk if the OS doesn't understand the type. A
  3427.           kind of Debug-Hunk that can be used by the OS.(V39)
  3428.  
  3429.     `ATTR=?'
  3430.           loads the hunk into the memory with specified memory
  3431.           attributs. (V37)
  3432.  
  3433. [Label] code [Name[, Memtyp]]
  3434. .............................
  3435.  
  3436.    defines a new code hunk and is equivalent to the command `section
  3437. ?,code,?'.
  3438.  
  3439.    * Name = Hunkname
  3440.  
  3441.    * Memtype defines the memory attributes for the hunk.
  3442.  
  3443.     `PUBLIC'
  3444.           loads the hunk into the memory with the highest priority.
  3445.           Code Suffix _p.
  3446.  
  3447.     `CHIP'
  3448.           loads the hunk into chip memory. Code Suffix _c.
  3449.  
  3450.     `FAST'
  3451.           loads the hunk into fast memory. Code Suffix _f.
  3452.  
  3453.     `ADVISORY'
  3454.           ignores the hunk if the OS doesn't understand the type. A
  3455.           kind of Debug-Hunk that can be used by the OS.(V39)
  3456.  
  3457.     `ATTR=?'
  3458.           loads the hunk into the memory with specified memory
  3459.           attributs. (V37)
  3460.  
  3461. [Label] data [Name[, Memtyp]]
  3462. .............................
  3463.  
  3464.    defines a new data hunk and is equivalent to the command `section
  3465. ?,data,?'.
  3466.  
  3467.    * Name = Hunkname
  3468.  
  3469.    * Memtype defines the memory attributes for the hunk.
  3470.  
  3471.     `PUBLIC'
  3472.           loads the hunk into the memory with the highest priority.
  3473.           Code Suffix _p.
  3474.  
  3475.     `CHIP'
  3476.           loads the hunk into chip memory. Code Suffix _c.
  3477.  
  3478.     `FAST'
  3479.           loads the hunk into fast memory. Code Suffix _f.
  3480.  
  3481.     `ADVISORY'
  3482.           ignores the hunk if the OS doesn't understand the type. A
  3483.           kind of Debug-Hunk that can be used by the OS.(V39)
  3484.  
  3485.     `ATTR=?'
  3486.           loads the hunk into the memory with specified memory
  3487.           attributs. (V37)
  3488.  
  3489. [Label] bss [Name[, Memtyp]]
  3490. ............................
  3491.  
  3492.    defines a new BSS hunk and is equivalent to the command `section
  3493. ?,bss,?'.
  3494.  
  3495.    * Name = Hunkname
  3496.  
  3497.    * Memtype defines the memory attributes for the hunk.
  3498.  
  3499.     `PUBLIC'
  3500.           loads the hunk into the memory with the highest priority.
  3501.           Code Suffix _p.
  3502.  
  3503.     `CHIP'
  3504.           loads the hunk into chip memory. Code Suffix _c.
  3505.  
  3506.     `FAST'
  3507.           loads the hunk into fast memory. Code Suffix _f.
  3508.  
  3509.     `ADVISORY'
  3510.           ignores the hunk if the OS doesn't understand the type. A
  3511.           kind of Debug-Hunk that can be used by the OS.(V39)
  3512.  
  3513.     `ATTR=?'
  3514.           loads the hunk into the memory with specified memory
  3515.           attributs. (V37)
  3516.  
  3517. [Label] cseg [Name[, Memtyp]]
  3518. .............................
  3519.  
  3520.    has the same function as the command `code'.
  3521.  
  3522. [Label] dseg [Name[, Memtyp]]
  3523. .............................
  3524.  
  3525.    has the same function as the command `data'.
  3526.  
  3527. idnt Name
  3528. .........
  3529.  
  3530.    defines the name of the `HUNK_UNIT' hunk in the object file.
  3531.  
  3532.    * Name = Hunkname
  3533.  
  3534. identify Name
  3535. .............
  3536.  
  3537.    defines the name of the actual hunk.
  3538.  
  3539.    * Name = Hunkname
  3540.  
  3541. BDebugArg Argument
  3542. ..................
  3543.  
  3544.    defines a parameter in env:BDebugProgram. It doesn't active this
  3545. function you have to activate by option "-J" in *Note BOPT: MI_BOPT.
  3546.  
  3547.    * Argument = Argument Text
  3548.  
  3549. smalldata [Register]
  3550. ....................
  3551.  
  3552.    activates smalldata mode for the hunk.  Optionally, you can also
  3553. define the smalldata register.  Default register is `A4'.  The program
  3554. itself must initialize the smalldata register with the address of the
  3555. smalldata data hunk.
  3556.  
  3557.  
  3558.  
  3559.       bopt    w2-            ;68020 addressmode warnings off
  3560.       mc68020            ;68020 mode activated
  3561.      
  3562.       smalldata    a3        ;Default is A4!!!
  3563.       xref    _LinkerDB        ;Special linker symbol
  3564.      
  3565.       lea.l    _LinkerDB,a3        ;Address of the smalldata data segments
  3566.       move.l    #0,(d_test.l,a3)
  3567.       move.l    #"TEST",d_test(a3)
  3568.       moveq    #0,d0
  3569.       tst.b    array(a3,d0.w)
  3570.       rts
  3571.      
  3572.       section    "__MERGED",BSS    ;The smalldata data segments are defined
  3573.                                      ;the following way
  3574.      d_test:
  3575.       ds.l    1
  3576.      array:
  3577.       ds.b    20
  3578.  
  3579. xref Symbol[, Symbol...]
  3580. ........................
  3581.  
  3582.    imports a symbol so that you can access symbols that were exported
  3583. by XDef.  The linker resolves these reference during the link process
  3584. and creates a program file.  If the assembler finds a XRef in the source
  3585. it creates an object file. This decision can be overruled.
  3586.  
  3587.    * Symbol = Name of the importet symbol.
  3588.  
  3589. xdef Symbol[, Symbol...]
  3590. ........................
  3591.  
  3592.    exports a symbol as global so that other object files can import the
  3593. symbol by XRef.  There's no need to define a symbol before you mark them
  3594. with XDef. If the assembler finds a XRef in the source it creates an
  3595. object file. This decision can be overruled.
  3596.  
  3597.    * Symbol = Name of the global symbol
  3598.  
  3599. global Symbol[, Symbol...]
  3600. ..........................
  3601.  
  3602.    has the same function like XDef.
  3603.  
  3604. public Symbol[, Symbol...]
  3605. ..........................
  3606.  
  3607.    has the same function like XDef.
  3608.  
  3609. .type Symbol, Type
  3610. ..................
  3611.  
  3612.    defines the type of a symbol. You need to define XDef functions as
  3613. @function if you want to link against it.  This is an ELF format option.
  3614.  
  3615.    * Symbol = Name of the Symbol
  3616.  
  3617.    * Type defines the type of the symbol.
  3618.  
  3619.     `@FUNCTION'
  3620.           defines the symbol as a function symbol.
  3621.  
  3622.     `@OBJECT'
  3623.           defines the symbol as a data object.
  3624.  
  3625. .size Symbol, Size
  3626. ..................
  3627.  
  3628.    defines the size of a symbol. This way it`s easy to define how long
  3629. a function is for example.  This is an ELF format option.
  3630.  
  3631.    * Symbol = Name of the Symbol
  3632.  
  3633.    * Size defines the size of the symbol.
  3634.  
  3635. output Name
  3636. ...........
  3637.  
  3638.    sets an output filename.  If you don't specify a filename the
  3639. assembler uses the source filename and adds the appropriate filetype
  3640. suffix.
  3641.  
  3642.    * Name = Filename
  3643.  
  3644. objfile
  3645. .......
  3646.  
  3647.    has the same function like Output.
  3648.  
  3649. exeobj
  3650. ......
  3651.  
  3652.    writes a program file if you want to overrule the assembler.
  3653.  
  3654. linkobj
  3655. .......
  3656.  
  3657.    writes an object file if you want to overrule the assembler.
  3658.  
  3659. org Address
  3660. ...........
  3661.  
  3662.    activates absolute mode.  All command that refer to hunk related
  3663. functions aren't allowed.  For example:. section, xdef, xref.  The
  3664. parameter address sets the base address of the created code.
  3665.  
  3666.    * Address = Absolute Address
  3667.  
  3668. addsym
  3669. ......
  3670.  
  3671.    writes a symbol hunk.
  3672.  
  3673. debug
  3674. .....
  3675.  
  3676.    writes a SAS D1 debug hunk to see  source level informations while
  3677. debugging the program through bdebug.
  3678.  
  3679. Symbol Commands
  3680. ---------------
  3681.  
  3682. CArgs [#Offset,]Symbol[,Symbol.w[,Symbol.l]
  3683. ...........................................
  3684.  
  3685.    defines the symbol offsets for a stack function. The first Symbol
  3686. starts with the offset 4 but if you like to use a different Offset it's
  3687. possible to specify one.  Then the offset is increased according to the
  3688. size of the symbol. If the symbol has no size specifier the default size
  3689. is word. Sorry..i would use a longword here but to be compatible with
  3690. Devpac i'm forced to use word.
  3691.  
  3692.       cargs Test1.w,Test2.l
  3693.       move.w    Test1(a7),d0    ;Test1=4
  3694.       move.l    Test2(a7),d0    ;Test2=4+2=6
  3695.  
  3696. Symbol rs[.width] Count
  3697. .......................
  3698.  
  3699.    initializes the Symbol with the value of the counter __RS and
  3700. increases the __RS counter afterwards by Count*Width.  You can use this
  3701. command as a replacement for the include exec/types.i macros to
  3702. increase the parsing speed.
  3703.  
  3704.    * Width
  3705.  
  3706.     `B'
  3707.           1 Byte Valuearea: -$80 <= x < $100
  3708.  
  3709.     `W'
  3710.           2 Bytes Valuearea: -$8000 <= x < $10000
  3711.  
  3712.     `L'
  3713.           4 Bytes Valuearea: -$80000000 <= x < $10000000
  3714.  
  3715.     `S'
  3716.           4 Bytes (Single IEEE-Float)
  3717.  
  3718.     `D'
  3719.           8 Bytes (Double IEEE-Float)
  3720.  
  3721.     `X'
  3722.           12 Bytes (Extended IEEE-Float)
  3723.  
  3724.     `P'
  3725.           12 Bytes (Packed BCD-Float)
  3726.  
  3727.     `Q'
  3728.           16 Bytes (Quadword)
  3729.  
  3730. Symbol so[.width] Count
  3731. .......................
  3732.  
  3733.    This command has the same function like rs with the exception that
  3734. the Symbol __SO is used instead of the __RS symbol.  Internally both
  3735. symbols are handled equal.  Devpac has introduced the symbol __RS and
  3736. Macro68k knows the functionality by the name __SO.
  3737.  
  3738. Symbol fo[.width] Count
  3739. .......................
  3740.  
  3741.    decreases the counter __FO by Count*Width and initializes the Symbol
  3742. with the new value.  Useful to create the negative local stackframe
  3743. symbols needed by link.
  3744.  
  3745.    * Width
  3746.  
  3747.     `B'
  3748.           1 Byte Valuearea: -$80 <= x < $100
  3749.  
  3750.     `W'
  3751.           2 Bytes Valuearea: -$8000 <= x < $10000
  3752.  
  3753.     `L'
  3754.           4 Bytes Valuearea: -$80000000 <= x < $10000000
  3755.  
  3756.     `S'
  3757.           4 Bytes (Single IEEE-Float)
  3758.  
  3759.     `D'
  3760.           8 Bytes (Double IEEE-Float)
  3761.  
  3762.     `X'
  3763.           12 Bytes (Extended IEEE-Float)
  3764.  
  3765.     `P'
  3766.           12 Bytes (Packed BCD-Float)
  3767.  
  3768.     `Q'
  3769.           16 Bytes (Quadword)
  3770.  
  3771. rsreset
  3772. .......
  3773.  
  3774.    initializes the counter __RS to 0.
  3775.  
  3776. rsset Value
  3777. ...........
  3778.  
  3779.    initializes the counter __RS with the Value
  3780.  
  3781.    * Value = New Index
  3782.  
  3783. clrso
  3784. .....
  3785.  
  3786.    has the same function like rsreset
  3787.  
  3788. clrfo
  3789. .....
  3790.  
  3791.    has the same function like foreset.
  3792.  
  3793. setso Value
  3794. ...........
  3795.  
  3796.    has the same function like rsset
  3797.  
  3798. setrs Value
  3799. ...........
  3800.  
  3801.    has the same function like rsset
  3802.  
  3803. setfo Value
  3804. ...........
  3805.  
  3806.    initializes the counter __FO with the Value
  3807.  
  3808.    * Value = New Index
  3809.  
  3810. Symbol rsval
  3811. ............
  3812.  
  3813.    initializes the Symbol with the value of the __RS counter.
  3814.  
  3815. Symbol soval
  3816. ............
  3817.  
  3818.    has the same function like rsval.
  3819.  
  3820. Symbol foval
  3821. ............
  3822.  
  3823.    initializes the Symbol with the value of the __FO counter.
  3824.  
  3825. Data Commands
  3826. -------------
  3827.  
  3828. align Value
  3829. ...........
  3830.  
  3831.    aligns the program counter to an address that can be devided by the
  3832. value.  Useful because certain DOS structures have to be aligned on 4
  3833. Byte boundaries. For example FileInfoBlock.  Furthermore it's also
  3834. useful to align subroutines on longword boundaries that they fit better
  3835. into the cache structure.
  3836.  
  3837.    * Value = Align Mask
  3838.  
  3839. cnop Offset,Align
  3840. .................
  3841.  
  3842.    aligns the program counter to an address that can be devided by the
  3843. Align value and adds the value onto the address.  Internally only Align
  3844. values < 16 are supported.
  3845.  
  3846. pad.Width Align[,Value]
  3847. .......................
  3848.  
  3849.    aligns the program counter to an address that can be devided by the
  3850. Align*Width and fills the aligned area by the optional mask value.
  3851.  
  3852. quad
  3853. ....
  3854.  
  3855.    aligns the program counter to a 16 Byte address.
  3856.  
  3857. even
  3858. ....
  3859.  
  3860.    aligns the program counter to an even address.  This function is
  3861. useful if you define an odd sized data area and you need a word aligned
  3862. for OS data structures or assembler instructions.
  3863.  
  3864. odd
  3865. ...
  3866.  
  3867.    aligns the program counter to an odd address.
  3868.  
  3869. dc[.width] Value[,Value...]
  3870. ...........................
  3871.  
  3872.    inserts data of the Width into the code.
  3873.  
  3874.    * Width
  3875.  
  3876.     `B'
  3877.           1 Byte Valuearea: -$80 <= x < $100
  3878.  
  3879.     `W'
  3880.           2 Bytes Valuearea: -$8000 <= x < $10000
  3881.  
  3882.     `L'
  3883.           4 Bytes Valuearea: -$80000000 <= x < $10000000
  3884.  
  3885.     `S'
  3886.           4 Bytes (Single IEEE-Float)
  3887.  
  3888.     `D'
  3889.           8 Bytes (Double IEEE-Float)
  3890.  
  3891.     `X'
  3892.           12 Bytes (Extended IEEE-Float)
  3893.  
  3894.     `P'
  3895.           12 Bytes (Packed BCD-Float)
  3896.  
  3897. db Value[,Value,...]
  3898. ....................
  3899.  
  3900.    inserts a byte with a value in the valuearea -$80 <= x < $100.
  3901.  
  3902. dw Value[,Value,...]
  3903. ....................
  3904.  
  3905.    inserts a word with a value in the valuearea -$8000 <= x < $10000.
  3906.  
  3907. dl Value[,Value,...]
  3908. ....................
  3909.  
  3910.    inserts a longword with a value in the valuearea -$80000000 <= x <
  3911. $100000000.
  3912.  
  3913. ub Value[,Value,...]
  3914. ....................
  3915.  
  3916.    inserts a byte with a value in the valuearea -$80 <= x < $80.
  3917.  
  3918. uw Value[,Value,...]
  3919. ....................
  3920.  
  3921.    inserts a word with a value in the valuearea -$8000 <= x < $8000.
  3922.  
  3923. ul Value[,Value,...]
  3924. ....................
  3925.  
  3926.    inserts a longword with a value in the valuearea -$80000000 <= x <
  3927. $80000000.
  3928.  
  3929. sb Value[,Value,...]
  3930. ....................
  3931.  
  3932.    inserts a byte with a value in the valuearea -$80 <= x < $100.
  3933.  
  3934. sw Value[,Value,...]
  3935. ....................
  3936.  
  3937.    inserts a word with a value in the valuearea -$8000 <= x < $10000.
  3938.  
  3939. sl Value[,Value,...]
  3940. ....................
  3941.  
  3942.    inserts a longword with a value in the valuearea -$80000000 <= x <
  3943. $100000000.
  3944.  
  3945. pb Value[,Value,...]
  3946. ....................
  3947.  
  3948.    inserts a byte with a value in the valuearea 0 <= x < $80.
  3949.  
  3950. pw Value[,Value,...]
  3951. ....................
  3952.  
  3953.    inserts a word with a value in the valuearea 0 <= x < $8000.
  3954.  
  3955. pl Value[,Value,...]
  3956. ....................
  3957.  
  3958.    inserts a longword with a value in the valuearea 0 <= x < $80000000.
  3959.  
  3960. nb Value[,Value,...]
  3961. ....................
  3962.  
  3963.    inserts a byte with a value in the valuearea -$80 <= x < 0.
  3964.  
  3965. nw Value[,Value,...]
  3966. ....................
  3967.  
  3968.    inserts a word with a value in the valuearea -$8000 <= x < 0.
  3969.  
  3970. nl Value[,Value,...]
  3971. ....................
  3972.  
  3973.    inserts a longword with a value in the valuearea -$80000000 <= x < 0.
  3974.  
  3975. ds[.width] Count[,Value]
  3976. ........................
  3977.  
  3978.    defines a memory area with the length Count * Width and fills the
  3979. area with an optional Value.  Default fill value is 0.  Is the Count 0
  3980. a cnop 0,Width is run.
  3981.  
  3982.    * Width
  3983.  
  3984.     `B'
  3985.           1 Byte Valuearea: -$80 <= x < $100
  3986.  
  3987.     `W'
  3988.           2 Bytes Valuearea: -$8000 <= x < $10000
  3989.  
  3990.     `L'
  3991.           4 Bytes Valuearea: -$80000000 <= x < $10000000
  3992.  
  3993.     `S'
  3994.           4 Bytes (Single IEEE-Float)
  3995.  
  3996.     `D'
  3997.           8 Bytes (Double IEEE-Float)
  3998.  
  3999.     `X'
  4000.           12 Bytes (Extended IEEE-Float)
  4001.  
  4002.     `P'
  4003.           12 Bytes (Packed BCD-Float)
  4004.  
  4005.    * Count = Length of the memory area.
  4006.  
  4007.    * Value = optional Fill Value.
  4008.  
  4009. dsb[.width] Count[,Value]
  4010. .........................
  4011.  
  4012.    has the same function like ds
  4013.  
  4014. dsb[.width] Count[,Value]
  4015. .........................
  4016.  
  4017.    has the same function like ds
  4018.  
  4019. blk[.width] Count[,Value...]
  4020. ............................
  4021.  
  4022.    has the same function like ds
  4023.  
  4024. ascii String1[,String2,...]
  4025. ...........................
  4026.  
  4027.    inserts Strings.
  4028.  
  4029. eascii EOR-Value,String1[,String2,...]
  4030. ......................................
  4031.  
  4032.    inserts eor-encrypted Strings.
  4033.  
  4034. cstring String1[,String2,...]
  4035. .............................
  4036.  
  4037.    inserts C-Strings.
  4038.  
  4039. dstring dtype1,dtype2,dtype3
  4040. ............................
  4041.  
  4042.    inserts the current date string.
  4043.  
  4044.                               Datentypen
  4045.  
  4046.    * "w" WeekDay
  4047.  
  4048.    * "d" Date
  4049.  
  4050.    * "t" Time
  4051.  
  4052.  
  4053.       dc.b    " ("
  4054.       dstring    w,d,t
  4055.       dc.b    ")"
  4056.       dc.b    $a,$d,0
  4057.      ;=> (Thursday 14-Okt-93 15:32:06)
  4058.  
  4059. pstring String[,String,...]
  4060. ...........................
  4061.  
  4062.    inserts a BCPL string.
  4063.  
  4064. istring String[,String,...]
  4065. ...........................
  4066.  
  4067.    inserts strings that terminate with a char that has Bit 7 set.
  4068.  
  4069. bitstream Mask
  4070. ..............
  4071.  
  4072.    inserts a bitmask for an image object for example.  The bits are
  4073. aligned to bytes.
  4074.  
  4075.    * Mask =  Mask is a string that is based only of 0 and 1.
  4076.  
  4077.  
  4078.       bitstream "01001000001"
  4079.  
  4080. sprintx "Formatstring"[,Value[,...]]
  4081. ....................................
  4082.  
  4083.    inserts the resulting string into the code.  The string isn't
  4084. terminated by a 0 so that you can add other strings rather easy.
  4085.  
  4086.    * FormatString - is a string in C-Notation so you can
  4087.            use the known C char types n,t,...
  4088.      The following options are allowed.
  4089.  
  4090.    * FormatSyntax - %[flags][width][.limit][length]type
  4091.  
  4092.         * flags - '-' deactivates left side layout.
  4093.  
  4094.         * width - Field Length. If the first char is '0' the field is
  4095.           filled by '0' on the left side.
  4096.  
  4097.         * limit - defines the maximal count of char that can be inserted
  4098.           from a string. Only legal for %s and %b.
  4099.  
  4100.         * length - The size of the datatype. Default is 16-bit for the
  4101.           typs %d,%u and %x. %l is long (32Bit). Attention! The
  4102.           Assembler always pushes a longword on the stack so always use
  4103.           %l if you don't know what you're doing.
  4104.  
  4105.         * type - The following types are supported.
  4106.  
  4107.           b - BSTR, a 32-bit BPTR Pointer on a bytelength     string.
  4108.             A NULL BPTR is handled like an empty string.  d - signed
  4109.           decimal u - unsigned decimal x - hexadezimal in lower case.
  4110.           X - hexadecimal in upper case.  s - String, a 32-bit Pointer
  4111.           on a     NULL-terminated Byte-String.      A NULL BPTR is
  4112.           handled like an empty string.  c - Char
  4113.  
  4114.    * Value - is an argument that has to be resolvable.
  4115.  
  4116. Listing I/O Commands
  4117. --------------------
  4118.  
  4119. list
  4120. ....
  4121.  
  4122.    activates the listing output. Has no function if the global listing
  4123. output wasn't activated.
  4124.  
  4125.                             Listing Format:
  4126.  
  4127.             LINE ADDRESS[Flag1] COMMAND-BYTES[Flag2] SOURCE
  4128.  
  4129.    * Flag1
  4130.  
  4131.         * + shows that the line was created by a macro.
  4132.  
  4133.         * > shows that the Assembler searches the closing ENDC.
  4134.  
  4135.         * < shows that the Assembler searches the closing ENDM.
  4136.  
  4137.    * Flag2
  4138.  
  4139.         * + shows a line overflow and that Bytes are ignored.  Can
  4140.           often happen during data definitions.
  4141.  
  4142. nolist
  4143. ......
  4144.  
  4145.    deactivates the listing output. Has no function if the global
  4146. listing output wasn't activated.
  4147.  
  4148. printx "Formatstring"[,Value[,...]]
  4149. ...................................
  4150.  
  4151.    outputs the string to the current Stdout and works similar as the
  4152. known C-Printf function. Look at SPRINTF
  4153.  
  4154. errfile Name
  4155. ............
  4156.  
  4157.    defines the filename for the error output.
  4158.  
  4159.    * Name = Filename
  4160.  
  4161. lisfile Name
  4162. ............
  4163.  
  4164.    defines the filename for the listing output.  If no error file was
  4165. defined the error output is also written into the listing file.
  4166.  
  4167.    * Name = Filename
  4168.  
  4169. Structuring
  4170. -----------
  4171.  
  4172. symbol[:] macro
  4173. ...............
  4174.  
  4175.    starts a Macro block.
  4176.  
  4177. endm
  4178. ....
  4179.  
  4180.    ends a macroblock.
  4181.  
  4182. mexit
  4183. .....
  4184.  
  4185.    ends a macro call.
  4186.  
  4187. fail
  4188. ....
  4189.  
  4190.    creates an error.
  4191.  
  4192. end
  4193. ...
  4194.  
  4195.    ends the assembling.
  4196.  
  4197. if Symbol
  4198. .........
  4199.  
  4200.    checks if the symbol value is not NULL and assembles the block
  4201. depending on the success.
  4202.  
  4203. ifd Symbol
  4204. ..........
  4205.  
  4206.    checks if the Symbol exists and assembles the block depending on the
  4207. success.
  4208.  
  4209. ifnd Symbol
  4210. ...........
  4211.  
  4212.    checks if the Symbol doesn't exist and assembles the block depending
  4213. on the success.
  4214.  
  4215. ifv String
  4216. ..........
  4217.  
  4218.    This is a privat command that is used for internal functionality and
  4219. subject to change. Touch an burn!
  4220.  
  4221. ifnv String
  4222. ...........
  4223.  
  4224.    This is a privat command that is used for internal functionality and
  4225. subject to change. Touch an burn!
  4226.  
  4227. ifmacrod Macro
  4228. ..............
  4229.  
  4230.    checks if the Macro exists and assembles the block depending on the
  4231. success.
  4232.  
  4233. ifmacrond Macro
  4234. ...............
  4235.  
  4236.    checks if the Macro doesn't exist and assembles the block depending
  4237. on the success.
  4238.  
  4239. ifcmacrod CMacro
  4240. ................
  4241.  
  4242.    checks if the CMacro exists and assembles the block depending on the
  4243. success.
  4244.  
  4245. ifcmacrond CMacro
  4246. .................
  4247.  
  4248.    checks if the CMacro doesn't exist and assembles the block depending
  4249. on the success.
  4250.  
  4251. ifc Symbol,Symbol
  4252. .................
  4253.  
  4254.    compares the first string with the second string and if they are
  4255. equal the block is assembled.
  4256.  
  4257. ifnc 'String','String'
  4258. ......................
  4259.  
  4260.    compares the first string with the second string and if they differ
  4261. the block is assembled.
  4262.  
  4263. if[condition] Symbol=Symbol
  4264. ...........................
  4265.  
  4266.    compares the first symbol with the second symbol and decides
  4267. according to the condition if the block is assembled.
  4268.  
  4269.    * Condition = Normal Bcc-Condition Syntax
  4270.  
  4271.    * Symbol = Normal Symbol
  4272.  
  4273. else
  4274. ....
  4275.  
  4276.    activates the condition block if the block above wasn't assembled.
  4277.  
  4278. elseif
  4279. ......
  4280.  
  4281.    activates the condition block if the block above wasn't assembled.
  4282.  
  4283. endc
  4284. ....
  4285.  
  4286.    defines the end of a condition block.
  4287.  
  4288. endif
  4289. .....
  4290.  
  4291.    defines the end of a condition block.
  4292.  
  4293. repeat Count
  4294. ............
  4295.  
  4296.    repeats the blocks that is located between repeat and endr by the
  4297. number Count.
  4298.  
  4299. rept Count
  4300. ..........
  4301.  
  4302.    has the same function like Repeat
  4303.  
  4304. procstart
  4305. .........
  4306.  
  4307.    defines a function in a Dice-C assembler output and is used to
  4308. optimize Link and Unlk.  This optimize method isn't working yet.
  4309.  
  4310. procend
  4311. .......
  4312.  
  4313.    defines a function in a Dice-C assembler output and is used to
  4314. optimize Link and Unlk.  This optimize method isn't working yet.
  4315.  
  4316. File I/O Commands
  4317. -----------------
  4318.  
  4319. incdir Dir[,Dir[,...]]
  4320. ......................
  4321.  
  4322.    adds directories to the include path list.  BASM uses 2 internal
  4323. path lists and the current directory to find the include and incbin
  4324. files.  First BASM checks for a : character in the filename and if it
  4325. finds a volume the file is loaded direct instead of searching it
  4326. through the pathlists.  The first path list contains the paths that
  4327. were defined in the commandline or *Note BOPT: MI_BOPT by the option -i
  4328. or through incdir.  The second path list contains the paths that were
  4329. defined in global configuration file ENV:BASMOption.  The entries of
  4330. the second list will be removed when the assembler is closed so that
  4331. the paths are still correct in ARexx-Mode.  The first list is removed
  4332. every pass.
  4333.  
  4334.    * Dir = Name of the Include-Path.
  4335.  
  4336. Incpath
  4337. .......
  4338.  
  4339.    has the same function like incdir.
  4340.  
  4341. include Name
  4342. ............
  4343.  
  4344.    loads the external include file, for example the OS-Includes.  If
  4345. the file is a precompiled include file it's detected automaticlly.
  4346. Includes are loaded from the editor or cachefile.library.
  4347.  
  4348.    * Name = Filename
  4349.  
  4350. include2 Name
  4351. .............
  4352.  
  4353.    has the same function like include with the exception that the
  4354. cachefile.library isn't ignored.
  4355.  
  4356.    * Name = Filename
  4357.  
  4358. incbin Name[,size]
  4359. ..................
  4360.  
  4361.    inserts the file with the optional length at the current address
  4362. into the code. Normally used for sounds and graphics.
  4363.  
  4364. incbin2 Name[,size]
  4365. ...................
  4366.  
  4367.    has the same function like incbin with the exception that the
  4368. cachefile.library isn't used.
  4369.  
  4370.    * Name = Name of the data file.
  4371.  
  4372. ibytes Name[,Length]
  4373. ....................
  4374.  
  4375.    has the same function like incbin
  4376.  
  4377. dsbin Name[,Length]
  4378. ...................
  4379.  
  4380.    defines a memory area with the length of the file specified by the
  4381. file. Optinally you can defined the maximal file length.
  4382.  
  4383.    * Name = Filename
  4384.  
  4385.    * Length = maximal file length
  4386.  
  4387. doscmd Name
  4388. ...........
  4389.  
  4390.    runs the program Name.
  4391.  
  4392.       dc.b    0,"$VER: Fubar 1.0 by Joe User"
  4393.       doscmd    "c:date >ram:Temp"
  4394.       incbin    ram:Temp
  4395.       doscmd    "c:delete ram:Temp"
  4396.  
  4397. filecom Name
  4398. ............
  4399.  
  4400.    sets the file comment of output file.
  4401.  
  4402.       filecom "This is a file comment"
  4403.  
  4404. pure
  4405. ....
  4406.  
  4407.    sets the Pure Bit while writing a program file.
  4408.  
  4409. Miscellaneous
  4410. -------------
  4411.  
  4412. trashreg Reglist
  4413. ................
  4414.  
  4415.    defines the registers that are available to the optimizer.
  4416.  
  4417.    * RegList = A normal Registerlist known by Movem.
  4418.  
  4419. super
  4420. .....
  4421.  
  4422.    deactivates Supervisor warnings.
  4423.  
  4424. mc[Type]
  4425. ........
  4426.  
  4427.    defines the 68k processor type to allow certain commands and
  4428. addressmodes.
  4429.  
  4430.                             Processor-Type
  4431.  
  4432.    * 68000 default mode
  4433.  
  4434.    * 68010
  4435.  
  4436.    * 68020
  4437.  
  4438.    * 68030
  4439.  
  4440.    * 68040
  4441.  
  4442.    * 68060
  4443.  
  4444.    * 68881
  4445.  
  4446.    * 68882
  4447.  
  4448. ppc[Type]
  4449. .........
  4450.  
  4451.    defines the ppc processor type. It also switches automaticly into
  4452. the ELF object mode.
  4453.  
  4454.                             Processor-Type
  4455.  
  4456.    * 601
  4457.  
  4458.    * 603
  4459.  
  4460.    * 604
  4461.  
  4462. bopt [opt[,...],...]
  4463. ....................
  4464.  
  4465.    sets the assembler options.
  4466.  
  4467.                                 Options
  4468.  
  4469. `m1[+,-]'
  4470.      activates/deactivates 68010 mode.
  4471.  
  4472. `m2[+,-]'
  4473.      activates/deactivates 68020 mode.
  4474.  
  4475. `m3[+,-]'
  4476.      activates/deactivates 68030 mode.
  4477.  
  4478. `m4[+,-]'
  4479.      activates/deactivates 68040 mode.
  4480.  
  4481. `m6[+,-]'
  4482.      activates/deactivates 68060 mode.
  4483.  
  4484. `mf[+,-]'
  4485.      activates/deactivates 68881/2 mode.
  4486.  
  4487. `ue[+,-]'
  4488.      activates/deactivates writing an executable file.
  4489.  
  4490. `uo[+,-]'
  4491.      activates/deactivates writing an object file.
  4492.  
  4493. `ua[+,-]'
  4494.      activates/deactivates writing an absolut file.
  4495.  
  4496. `un[+,-]'
  4497.      activates/deactivates writing file.
  4498.  
  4499. `p[+,-]'
  4500.      activates/deactivates writing a preassembled Include file.
  4501.  
  4502. `g[+,-]'
  4503.      activates/deactivates adding the prefix _ to each exported symbol.
  4504.      Default is off.
  4505.  
  4506. `sx[+,-]'
  4507.      activates/deactivates writing all XRef/XDef symbols to a symbol
  4508.      hunk.  Default is off.
  4509.  
  4510. `sl[+,-]'
  4511.      activates/deactivates writing all normal symbols to a symbol hunk.
  4512.      Default is off.
  4513.  
  4514. `sa[+,-]'
  4515.      activates/deactivates writing all symbols to a symbol hunk.
  4516.      Default is off.
  4517.  
  4518. `sd[+,-]'
  4519.      activates/deactivates writing a BASM custom format Debug Hunk.
  4520.      Makes only sense as a program file and it needs a lot hd space
  4521.      because it includes all sources. Default is off.
  4522.  
  4523. `s1[+,-]'
  4524.      activates/deactivates writing a SAS D1 compatible Debug Hunk.
  4525.      Default is off.
  4526.  
  4527. `sf[+,-]'
  4528.      activates/deactivates writing the full sourcefile path into the
  4529.      debug hunk.  You should only use this for your own development
  4530.      system because other users may have different HD layouts. This
  4531.      option has only a meaning with in a SAS D1 Debug Hunk. Default is
  4532.      off.
  4533.  
  4534. `j[+,-]'
  4535.      activates/deactivates setting the PURE Bit for a program file.
  4536.      The PURE Bit tells the Shell that this program can be loaded
  4537.      resident.  Default is off.
  4538.  
  4539. `J[+,-]'
  4540.      activates/deactivates creating the file ENV:BDebugProgram that
  4541.      contains the assembled filename for BDebug.  Default is off.
  4542.  
  4543. `a[+,-]'
  4544.      activates/deactivates creating of an .info file for each program.
  4545.      Useful if you use the assembler through the WB.  Default is off.
  4546.  
  4547. `A[+,-]'
  4548.      activates/deactivates Arexxmode. Only allowed in the commandline.
  4549.      Default is off.
  4550.  
  4551. `i<DirName>'
  4552.      defines the include path.
  4553.  
  4554. `o<FileName>'
  4555.      defines the object filename. If not specified the assembler uses
  4556.      the source file name without the source suffix as the output name.
  4557.      For object files it adds the suffix `.o'.
  4558.  
  4559. `P<Priority>'
  4560.      sets the task priority.
  4561.  
  4562. `c[+,-]'
  4563.      activates/deactivates that the assembler interpretes Upper and
  4564.      Lower case as 2 different chars.  Default is on.
  4565.  
  4566. `f[+,-]'
  4567.      activates/deactivates a faster mode that resolves all references
  4568.      in the 2nd pass.  Fortunately this mode needs more memory and has
  4569.      some disadvantages like uncorrect values during the listing.  This
  4570.      option has no effect during optimizing.  Default is off.
  4571.  
  4572. `F[+,-]'
  4573.      activates/deactivates a faster IO mode that keeps include paths as
  4574.      locks instead of strings.  The older basm versions used locks to
  4575.      store paths but as this isn't compatible with multi-assigns I
  4576.      changed that.
  4577.  
  4578. `M<Bytes>'
  4579.      defines the max macro expansion size.  If you get a macromemerror
  4580.      you should increase the size. Default 1000 Bytes.
  4581.  
  4582. `Z<Address>'
  4583.      tells the assembler that the source is starts in the memory at the
  4584.      defined address.  Useful for ARexx scripts.  Option is only
  4585.      available in the commandline.
  4586.  
  4587. `x[+,-]'
  4588.      uses the `cachefile.library' to load resident Includes/Incbins or
  4589.      add unknown files to the cachefile.library database.  Default is
  4590.      off.
  4591.  
  4592. `X[+,-]'
  4593.      erases all files that are controled by the cachefile.library.
  4594.      Default is off.
  4595.  
  4596. `y[+,-]'
  4597.      shows all files that are controled by the cachefile.library.
  4598.      Default is off.
  4599.  
  4600. `l[+,-]'
  4601.      activates/deactivates the listing output.  Default is off.
  4602.  
  4603. `l0[+,-]'
  4604.      activates/deactivates the listing macro expansion.  Default is on.
  4605.  
  4606. `L<Listingfile>'
  4607.      defines the Listing filename.
  4608.  
  4609. `h[+,-]'
  4610.      activates/deactivates the symbol listing output.  Default is off.
  4611.  
  4612. `H[+,-]'
  4613.      activates/deactivates the unused symbol output.  Default is off.
  4614.  
  4615. `v[+,-]'
  4616.      outputs a statistic after assembling.  Default is off.
  4617.  
  4618. `V[+,-]'
  4619.      as little status output as possible Default is off.
  4620.  
  4621. `e[+,-]'
  4622.      creates an error list.  Default is on.
  4623.  
  4624. `es[+,-]'
  4625.      outputs the error list in the Barfly shell.  This option has no
  4626.      meaning in BASM.
  4627.  
  4628. `wo[+,-]'
  4629.      activates/deactivates Optimizing warnings.  Default is on.
  4630.  
  4631. `ws[+,-]'
  4632.      activates/deactivates Supervisor warnings.  Default is on.
  4633.  
  4634. `wm[+,-]'
  4635.      activates/deactivates Move16 warnings because the use of the
  4636.      move16 command is dangerous if you don't know the problems.
  4637.      Default is on.
  4638.  
  4639. `wp[+,-]'
  4640.      activates/deactivates pc-relative access to different section
  4641.      warnings. The linker is needed to resolve such files.  Default is
  4642.      on.
  4643.  
  4644. `w2[+,-]'
  4645.      activates/deactivates 68020 addressmode warnings.  Default is on.
  4646.  
  4647. `w4[+,-]'
  4648.      activates/deactivates 64k-Access warnings.  It's useful if you
  4649.      accidently avoid to forget the address register.  Example: move.l
  4650.      8,d0 instead of move.l 8(an),d0 Default is on.
  4651.  
  4652. `b0'
  4653.      sets the Default Branch Length to 8-Bit. .b Default is off.
  4654.  
  4655. `b1'
  4656.      sets the Default Branch Length to 16-Bit. .w Default is on.
  4657.  
  4658. `b2'
  4659.      sets the Default Branch Length to 32-Bit. .l Default is off.
  4660.  
  4661. `B0'
  4662.      sets the Default BaseDisplacement-Width to 8 Bit. .b Default is on.
  4663.  
  4664. `B1'
  4665.      sets the Default BaseDisplacement-Width to 16 Bit. .w Default is
  4666.      off.
  4667.  
  4668. `B2'
  4669.      sets the Default BaseDisplacement-Width to 32 Bit. .l Default is
  4670.      off.
  4671.  
  4672. `n0'
  4673.      sets the Default OuterDisplacement-Width to 16 Bit. .w Default is
  4674.      off.
  4675.  
  4676. `n1'
  4677.      sets the Default OuterDisplacement-Width to 32 Bit. .l Default is
  4678.      on.
  4679.  
  4680. `q[+,-]'
  4681.      activates/deactivates align long after each rts, bra or jmp to
  4682.      align blocks to the cache structure.  Default is off.
  4683.  
  4684. `O[+,-]'
  4685.      activates/deactivates the Optimizer.  Without this option no
  4686.      optimizing will happen besides addressmode converting.  Default is
  4687.      off.
  4688.  
  4689. `OG[+,-]'
  4690.      activates/deactivates Forward Reference Optimizing to use every
  4691.      possibility. In this mode the source is assembled until no further
  4692.      optimizing method is found.  First the source is assembled
  4693.      normally.  This is shown by the Output Pass 1.  Afterwards the
  4694.      optimize passes are started and continued until no further symbol
  4695.      changes and length errors occur.  This can take a while and
  4696.      depends on the source size. Default is off.
  4697.  
  4698. `OT[+,-]'
  4699.      activates/deactivates Time Optimizing.  Default is off.
  4700.  
  4701.      Addressmode Converting
  4702.  
  4703. `OC0[+,-]'
  4704.      *Note bdwan: OP_DIRECT
  4705.  
  4706. `OC1[+,-]'
  4707.      *Note bdwpc: OP_DIRECT
  4708.  
  4709. `OC2[+,-]'
  4710.      *Note anxn: OP_DIRECT
  4711.  
  4712. `OC3[+,-]'
  4713.      *Note pcxn: OP_DIRECT
  4714.  
  4715. `OC4[+,-]'
  4716.      *Note bdw: OP_DIRECT
  4717.  
  4718. `OC5[+,-]'
  4719.      *Note bdl: OP_DIRECT
  4720.  
  4721. `OC6[+,-]'
  4722.      *Note an: OP_DIRECT
  4723.  
  4724. `OC7[+,-]'
  4725.      *Note pc: OP_DIRECT
  4726.  
  4727. `ODD[+,-]'
  4728.      activates Direct Addressmode Optimizing
  4729.  
  4730.      Direct Optimizing
  4731.  
  4732. `OD0[+,-]'
  4733.      *Note move: OP_OPTIMIZE
  4734.  
  4735. `OD00[+,-]'
  4736.      *Note move: OP_OPTIMIZE
  4737.  
  4738. `OD01[+,-]'
  4739.      *Note move: OP_OPTIMIZE
  4740.  
  4741. `OD02[+,-]'
  4742.      *Note move: OP_OPTIMIZE
  4743.  
  4744. `OD03[+,-]'
  4745.      *Note move: OP_OPTIMIZE
  4746.  
  4747. `OD04[+,-]'
  4748.      *Note move: OP_OPTIMIZE
  4749.  
  4750. `OD05[+,-]'
  4751.      *Note move: OP_OPTIMIZE
  4752.  
  4753. `OD06[+,-]'
  4754.      *Note move: OP_OPTIMIZE
  4755.  
  4756. `OD07[+,-]'
  4757.      *Note move: OP_OPTIMIZE
  4758.  
  4759. `OD08[+,-]'
  4760.      *Note move: OP_OPTIMIZE
  4761.  
  4762. `OD09[+,-]'
  4763.      *Note move: OP_OPTIMIZE
  4764.  
  4765. `OD0a[+,-]'
  4766.      *Note move: OP_OPTIMIZE
  4767.  
  4768. `OD1[+,-]'
  4769.      *Note clr: OP_OPTIMIZE
  4770.  
  4771. `OD2[+,-]'
  4772.      *Note add: OP_OPTIMIZE
  4773.  
  4774. `OD3[+,-]'
  4775.      *Note sub: OP_OPTIMIZE
  4776.  
  4777. `OD4[+,-]'
  4778.      *Note lea: OP_OPTIMIZE
  4779.  
  4780. `OD5[+,-]'
  4781.      *Note cmp: OP_OPTIMIZE
  4782.  
  4783. `OD6[+,-]'
  4784.      *Note bcc: OP_OPTIMIZE
  4785.  
  4786. `OD7[+,-]'
  4787.      *Note jsr: OP_OPTIMIZE
  4788.  
  4789. `OD8[+,-]'
  4790.      *Note jmp: OP_OPTIMIZE
  4791.  
  4792. `OD9[+,-]'
  4793.      *Note asl: OP_OPTIMIZE
  4794.  
  4795. `ODa[+,-]'
  4796.      *Note or: OP_OPTIMIZE  ( This Optimizing is deactivated internal )
  4797.  
  4798. `ODb[+,-]'
  4799.      *Note eor: OP_OPTIMIZE ( This Optimizing is deactivated internal )
  4800.  
  4801. `ODc[+,-]'
  4802.      *Note and: OP_OPTIMIZE
  4803.  
  4804. `ODd[+,-]'
  4805.      *Note mulu: OP_OPTIMIZE
  4806.  
  4807. `ODe[+,-]'
  4808.      *Note muls: OP_OPTIMIZE
  4809.  
  4810. `ODf[+,-]'
  4811.      *Note jsr+rts: OP_OPTIMIZE
  4812.  
  4813. `ODg[+,-]'
  4814.      *Note jmp+rts: OP_OPTIMIZE
  4815.  
  4816. `ODh[+,-]'
  4817.      *Note MovemNoRegister: OP_OPTIMIZE
  4818.  
  4819. `ODi[+,-]'
  4820.      *Note MovemOneRegister: OP_OPTIMIZE
  4821.  
  4822. `ODj[+,-]'
  4823.      *Note Link: OP_OPTIMIZE
  4824.  
  4825. `OAP[+,-]'
  4826.      activates *Note PC-Relative: OP_ADDRESS Optimizing
  4827.  
  4828. `OAS[+,-]'
  4829.      activates *Note Smalldata: OP_ADDRESS Optimizing
  4830.  
  4831. `OAL[+,-]'
  4832.      activates *Note long to word: OP_ADDRESS Optimizing
  4833.  
  4834. `OAX[+,-]'
  4835.      activates *Note x(An) to (An): OP_ADDRESS Optimizing
  4836.  
  4837. `OAY[+,-]'
  4838.      activates *Note 68020 An-EA: OP_ADDRESS Optimizing
  4839.  
  4840. `OAZ[+,-]'
  4841.      activates *Note 68020 PC-EA: OP_ADDRESS Optimizing
  4842.  
  4843. `OAR[+,-]'
  4844.      activates *Note Register: OP_REGISTER Optimizing
  4845.  
  4846.    You should be careful with the command *Note BOPT: MI_BOPT when you
  4847. activate Global-Optimize.  In every parse the default config is set and
  4848. therefore you should define all global options in the commandline or in
  4849. the configuration file.
  4850.  
  4851. 680xx Meta Commands
  4852. -------------------
  4853.  
  4854. mb Operand1,Operand2
  4855. ....................
  4856.  
  4857.    has the same function as move.b.
  4858.  
  4859. mw Operand1,Operand2
  4860. ....................
  4861.  
  4862.    has the same function as move.w.
  4863.  
  4864. ml Operand1,Operand2
  4865. ....................
  4866.  
  4867.    has the same function as move.l.
  4868.  
  4869. mq Operand1,Operand2
  4870. ....................
  4871.  
  4872.    has the same function as moveq.
  4873.  
  4874. xor.? Operand1,Operand2
  4875. .......................
  4876.  
  4877.    has the same function as eor.?.
  4878.  
  4879. xori.? Operand1,Operand2
  4880. ........................
  4881.  
  4882.    has the same function as eori.?.
  4883.  
  4884. bhs.? Label
  4885. ...........
  4886.  
  4887.    has the same function as bcc.?.
  4888.  
  4889. blo.? Label
  4890. ...........
  4891.  
  4892.    has the same function as bcs.?.
  4893.  
  4894. Assembler Macros
  4895. ================
  4896.  
  4897.    Macros are meta commands that can be based of many assembler
  4898. instructions to achieve an abstracter source layout.  In a macro you
  4899. can use several different pattern that are replaced by appropriate
  4900. parameters when the macro is called.  The parameter that are passed
  4901. during a macro call are represented by the following patterns:
  4902. \0,...,\9, \a,...,\z, \A,...,\Z.  The pattern ids are using the
  4903. hexadecimal format.  If a pattern is used with no related parameter an
  4904. empty string is inserted.  Furthermore if a parameter contains
  4905. tabulators or spaces it has to be placed between <...>.  When a macro
  4906. needs relative labels and is should be called more than one time you
  4907. should use the special pattern @.  This pattern is replaced by a number
  4908. that is based of 4 digits and that is increased after each call.  The
  4909. pattern \# is replaced by the value of the symbol narg that represents
  4910. the count of macro parameters.  Besides the standard patterns there are
  4911. some more advanced pattern functions supported that look like
  4912. \*Function-Name.  These functions don't belong to the motorola standard
  4913. thus they aren't supported by every assembler.  Another important point
  4914. is that you can also call macros from from macros but you can't define
  4915. macros in macros.
  4916.  
  4917.    The standard macro pattern
  4918.  
  4919.    Label & [. string] & [, string] & [, string] & [,...]        & [\\0]
  4920. & [\\1|] & [\\2|] & [\\3|]...[\\n|]
  4921.  
  4922.    The advanced macro pattern functions
  4923.  
  4924.    * ` \(Argument)' inserts the string of the macroparameter with the
  4925.      number the argument defines.
  4926.  
  4927.  
  4928.           \(1) =  \1
  4929.           \(1+3+4) = \8
  4930.  
  4931.    * `\*upper(String)' inserts the string in upper case.
  4932.  
  4933.    * `\*lower(String)' inserts the string in lower case.
  4934.  
  4935.    * `\*valof(Argument)' inserts the decimal value of the argument as a
  4936.      string.
  4937.  
  4938.    * `\*strlen(Symbol)' inserts the length of a symbol as a string.
  4939.  
  4940.    * `\*right(String,n)' inserts n chars of the right side of the
  4941.      string.  If the string contains less than n chars the whole string
  4942.      is inserted.
  4943.  
  4944.    * `\*left(String,n)' inserts n chars of the left side of the string.
  4945.      If the string contains less than n chars the whole string is
  4946.      inserted.
  4947.  
  4948.    * `\*mid(String,n,m)' inserts chars from position n to m from the
  4949.      string.  If the position is outside of the string length the chars
  4950.      till the end of the string is inserted.
  4951.  
  4952.  
  4953.      openwind MACRO
  4954.               move.l     intbase,a6
  4955.               lea.l      \1,a0
  4956.               jsr        OpenWindow(a6)
  4957.               ENDM
  4958.      
  4959.      start:
  4960.               openwind   newwindow
  4961.  
  4962.  
  4963.  
  4964.      movewind MACRO
  4965.               move.l     intbase,a6
  4966.               move.l     \1,a0
  4967.               moveq      #0,d0
  4968.               move.\0    \2,d1
  4969.               IFC        `\0',`b'
  4970.               ext.w      d1
  4971.               ENDC
  4972.               jsr        MoveWindow(a6)
  4973.               ENDM
  4974.      
  4975.      start:
  4976.               move.b     #10,d2
  4977.      1$:
  4978.               movewind.b newwindow,d2
  4979.               addq.b     #1,d2
  4980.               cmp.b      #100,d2
  4981.               bne.s      1$
  4982.  
  4983.  
  4984.      wait MACRO
  4985.               moveq      #-1,d0
  4986.      wait\
  4987.               dbra       d0,wait\
  4988.               ENDM
  4989.      
  4990.      start:
  4991.               wait
  4992.               wait
  4993.               wait
  4994.  
  4995.  
  4996.      test MACRO
  4997.               move.l     #\*upper(Hello),d0
  4998.               move.l     #\*lower(Hello),d0
  4999.               move.l     #\*strlen(1234567890123456),d0
  5000.               move.l     #\*valof(value),d0
  5001.               rts
  5002.      
  5003.               cstring    "\*left(abcdefgh,4)"
  5004.               even
  5005.               cstring    "\*left(abcdefgh,10)"
  5006.               even
  5007.               cstring    "\*right(abcdefgh,4)"
  5008.               even
  5009.               cstring    "\*right(abcdefgh,10)"
  5010.               even
  5011.               cstring    "\*mid(abcdefgh,2,4)"
  5012.               even
  5013.               cstring    "\*mid(abcdefgh,2,8)"
  5014.               even
  5015.      
  5016.               ENDM
  5017.      
  5018.      value = 123456789
  5019.      hello:
  5020.               test
  5021.  
  5022.  
  5023.       value = 123456789
  5024.      
  5025.      
  5026.      hello:
  5027.               move.l     #HELLO,d0
  5028.               move.l     #hello,d0
  5029.               move.l     #16,d0
  5030.               move.l     #123456789,d0
  5031.               rts
  5032.               cstring    "abcd"
  5033.               even
  5034.               cstring    "abcdefgh"
  5035.               even
  5036.               cstring    "efgh"
  5037.               even
  5038.               cstring    "abcdefgh"
  5039.               even
  5040.               cstring    "cdef"
  5041.               even
  5042.               cstring    "cdefgh"
  5043.               even
  5044.  
  5045.  
  5046.      PUTTAG MACRO
  5047.               IFC        "\2",""
  5048.      PUTTAG_COUNT set 0
  5049.               ENDC
  5050.      
  5051.               IFNC       "\2",""
  5052.               move.l     \2,-(a7)
  5053.      PUTTAG_COUNT SET PUTTAG_COUNT+4
  5054.               ENDC
  5055.      
  5056.               move.l     \1,-(a7)
  5057.      PUTTAG_COUNT SET PUTTAG_COUNT+4
  5058.      
  5059.               IFC        "\1","#TAG_END"
  5060.      PUTTAG_COUNT SET 4
  5061.               ENDC
  5062.      
  5063.               ENDM
  5064.      
  5065.      CLEARTAG MACRO
  5066.               lea.l      PUTTAG_COUNT(a7),a7
  5067.               ENDM
  5068.      
  5069.      
  5070.      
  5071.               PUTTAG     #TAG_END
  5072.               PUTTAG     #WA_Width,#100
  5073.               PUTTAG     #WA_ScreenTitle,#Title
  5074.               .
  5075.               .
  5076.               move.l     a7,a1
  5077.               sub.l      a0,a0
  5078.               jsr        OpenWindowTagList(a6)
  5079.               CLEARTAG
  5080.  
  5081. Highlevel Macros
  5082. ================
  5083.  
  5084.    In highlevel macros the operands are based of legal addressmodes.
  5085. Arguments are based of operands and the operators +,-,<<,>>. Conditions
  5086. are based of !,=, <,>,<=,>=,<>.  By using highlevel macros you can make
  5087. the programming of non critical source areas easier and more abstract.
  5088. Blame Mike Schwartz for this idea...he forced me to do it:-B
  5089.  
  5090. .REG
  5091. ....
  5092.  
  5093.    sets the accumulator register that is used to calculate arguments.
  5094. Default register is D0.
  5095.  
  5096. .BRANCH b|w|l
  5097. .............
  5098.  
  5099.    sets the length of branch commands that are used in the highlevel
  5100. macros.  Standard length is .b.
  5101.  
  5102. .FOR Operand[.b|w|l] = Operand TO Operand STEP Operand
  5103. ......................................................
  5104.  
  5105.    creates code for a for loop.  The optional width you define after
  5106. the first operand sets the width for all operations in the for loop.
  5107.  
  5108.  
  5109.        .FOR   d0.w = #1 to  STEP #2
  5110.        addq.w #1,d1
  5111.        .NEXT
  5112.      
  5113.        ;Compiled Code
  5114.      
  5115.        move.w #1,d0
  5116.      __for1:
  5117.        addq.w #1,d1
  5118.        add.w  #2,d0
  5119.        cmp.w  ,d0
  5120.        blt.b  __for1
  5121.  
  5122. .NEXT
  5123. .....
  5124.  
  5125.    closes the outer .FOR loop.
  5126.  
  5127. .IF [Argument] =,!, < , > , <> Operand
  5128. ......................................
  5129.  
  5130.    creates code for an IF-Operation.  You can remove the first argument
  5131. if you want to test the operand.  For example .IF <>
  5132.  
  5133.  
  5134.        .IF    (a0) + #0 <> d1
  5135.        moveq  #0,d0
  5136.        .ELSE
  5137.        moveq  #1,d0
  5138.        .ENDIF
  5139.      
  5140.        ;Compiled Code
  5141.      
  5142.        move.l (a0),d7
  5143.        add.l  #0,d7
  5144.        cmp.l  d1,d7
  5145.        beq.b  __else1
  5146.        moveq  #0,d0
  5147.        bra.b  __endif1
  5148.      __else1:
  5149.        moveq  #1,d0
  5150.      __endif1:
  5151.  
  5152. .ELSE
  5153. .....
  5154.  
  5155.    starts an alternative IF-Block.
  5156.  
  5157. .ENDIF
  5158. ......
  5159.  
  5160.    closes the outer .IF block.
  5161.  
  5162. .WHILE [Argument] =,!, < , > , <> Operand
  5163. .........................................
  5164.  
  5165.    creates code for a while loop The optional width you define after
  5166. the first operand sets the width for all operations in the while loop.
  5167.  
  5168.  
  5169.        .WHILE d0 <> #0
  5170.        addq.w #1,d1
  5171.        .ENDWHILE
  5172.      
  5173.        ;Compiled Code
  5174.      
  5175.      __while1:
  5176.        cmp.l  #0,d0
  5177.        beq.s  __endwhile1
  5178.        addq.w #1,d1
  5179.        bra.s  __while1
  5180.      __endwhile1:
  5181.  
  5182. .ENDWHILE
  5183. .........
  5184.  
  5185.    closes the outer while loop.
  5186.  
  5187. .CALL Function [, Argument [, Argument [,...]]]
  5188. ...............................................
  5189.  
  5190.    calls a C-Function by parsing the arguments through the stack.
  5191. Arguments are calculated in the accumulator register.
  5192.  
  5193.  
  5194.  
  5195.        .CALL func , test + 0 - #20 , #test
  5196.      
  5197.        ;Compiled Code
  5198.      
  5199.        move.l test,d7
  5200.        add.l  0,d7
  5201.        sub.l  #20,d7
  5202.        move.l d7,-(a7)
  5203.        move.l #test,-(a7)
  5204.        jsr    func
  5205.        ifnc   "8","0"             ;Were there any parameters ?
  5206.        lea.l  __CALLSize(a7),a7
  5207.        endc
  5208.  
  5209. .RETURN Argument
  5210. ................
  5211.  
  5212.    returns a result value in the accumulator register.
  5213.  
  5214.  
  5215.        .return d1 + d2 + #$100
  5216.      
  5217.        ;Compiled Code
  5218.      
  5219.      
  5220.        move.l d1,d7
  5221.        add.l  d2,d7
  5222.        add.l  #$100,d7
  5223.  
  5224. .DEF func [, Operand [, Operand [,...]]]
  5225. ........................................
  5226.  
  5227.    defines a C-Stack function and loads the defined parameters into the
  5228. operands.
  5229.  
  5230.  
  5231.        .DEF func , d0.w , d1 , (a0)
  5232.        .ENDDEF
  5233.      
  5234.        ;Compiled Code
  5235.      
  5236.        XDEF   func
  5237.        link   a5,#0
  5238.        move.w $0a(a5),d0
  5239.        move.l $0c(a5),d1
  5240.        move.l $10(a5),(a0)
  5241.        unlk   a5            ;.ENDDEF
  5242.        rts
  5243.  
  5244. .ENDDEF
  5245. .......
  5246.  
  5247.    closes a function that was started by .DEF
  5248.  
  5249. .LET [ Operand =] Argument
  5250. ..........................
  5251.  
  5252.    calculates an argument in an accumulator or moves the value to a
  5253. defined operand.
  5254.  
  5255.  
  5256.        .LET + 4 - #LN_SIZE << #7
  5257.        .LET d1 = (a1) - (a0)
  5258.      
  5259.        ;Compiled Code
  5260.      
  5261.        add.l  4,d7
  5262.        sub.l  #LN_SIZE,d7
  5263.        lsl.l  #7,d7
  5264.      
  5265.        move.l (a1),d7
  5266.        sub.l  (a0),d7
  5267.        move.l d7,d1
  5268.  
  5269. Predefined Symbols
  5270. ==================
  5271.  
  5272. NARG
  5273. ....
  5274.  
  5275.    represents the macro parameter count in a macro.
  5276.  
  5277. BARFLY
  5278. ......
  5279.  
  5280.    represents the assembler version.
  5281.  
  5282. 680xx
  5283. .....
  5284.  
  5285.    represents the CPU processor type.
  5286.  
  5287. 6888x
  5288. .....
  5289.  
  5290.    represents the FPU processor type.
  5291.  
  5292. _MOVEMBYTES
  5293. ...........
  5294.  
  5295.    represents the byte count the last movem transfer used.
  5296.  
  5297.  
  5298.       lea    _MOVEMBYTES(a7),a7    ;frees the stack
  5299.  
  5300. _MOVEMREGS
  5301. ..........
  5302.  
  5303.    represents the last movem register mask.
  5304.  
  5305.  
  5306.       movem    (a7)+,_MOVEMREGS
  5307.  
  5308. __RS
  5309. ....
  5310.  
  5311.    represents the RS-Counter.
  5312.  
  5313. __SO
  5314. ....
  5315.  
  5316.    represents the RS-Counter.
  5317.  
  5318. __FO
  5319. ....
  5320.  
  5321.    represents the FO-Counter.
  5322.  
  5323. Optimizing
  5324. ==========
  5325.  
  5326.    Optimize Methods...
  5327.  
  5328. Direct Addressmode Optimizing
  5329. -----------------------------
  5330.  
  5331.    The assembler can direct optimize certain 68020...60 Addressmodes if
  5332. a faster 68000 addressmode exists.  This optimizing method should
  5333. always be activated because of compatibility reasons.
  5334.  
  5335.    * `(bd.w,an)' can be optimized to `x(an)' that removes 1 word and
  5336.      some cycles.
  5337.  
  5338.      +------------------------+--------------------+--------+
  5339.      |       Addressmode      |     Optimizing     | Option |
  5340.      +------------------------+--------------------+--------+
  5341.      +------------------------+--------------------+--------+
  5342.      | move. l (1000.w,an),dn | move.l 1000(an),dn |  -OC0  |
  5343.      +------------------------+--------------------+--------+
  5344.  
  5345.    * `(bd.w,pc)' can be optimized to `x(pc)' that removes 1 word and
  5346.      some cycles.
  5347.  
  5348.      +------------------------+--------------------+--------+
  5349.      |       Addressmode      |     Optimizing     | Option |
  5350.      +------------------------+--------------------+--------+
  5351.      +------------------------+--------------------+--------+
  5352.      | move. l (1000.w,pc),dn | move.l 1000(pc),dn |  -OC1  |
  5353.      +------------------------+--------------------+--------+
  5354.  
  5355.    * `(bd.w)' can be optimized to `bd.w' that removes 1 word and some
  5356.      cycles.
  5357.  
  5358.      +------------------------+--------------------+--------+
  5359.      |       Addressmode      |     Optimizing     | Option |
  5360.      +------------------------+--------------------+--------+
  5361.      +------------------------+--------------------+--------+
  5362.      |  move. l (bd.w),dn     |   move.l bd.w,dn   |  -OC4  |
  5363.      +------------------------+--------------------+--------+
  5364.  
  5365.    * `(bd.l)' can be optimized to `bd.l' that removes 1 word and some
  5366.      cycles.
  5367.  
  5368.      +------------------------+--------------------+--------+
  5369.      |       Addressmode      |     Optimizing     | Option |
  5370.      +------------------------+--------------------+--------+
  5371.      +------------------------+--------------------+--------+
  5372.      |  move. l (bd.l),dn     |   move.l bd.l,dn   |  -OC5  |
  5373.      +------------------------+--------------------+--------+
  5374.  
  5375.    * `(an)' can be optimized to `(an)' that removes 1 word and some
  5376.      cycles.  The addressmode `(an)' can be interpreted as a subgroup
  5377.      of `(bd,an,xn)'. Because `(an)' is a normal 68000 addressmode you
  5378.      should never switch off this optimizing method.
  5379.  
  5380.      +------------------------+--------------------+--------+
  5381.      |       Addressmode      |     Optimizing     | Option |
  5382.      +------------------------+--------------------+--------+
  5383.      +------------------------+--------------------+--------+
  5384.      |     move. l (an),dn    |   move.l (an),dn   |  -OC6  |
  5385.      +------------------------+--------------------+--------+
  5386.  
  5387.    * `(pc)' can be optimized to `(pc)' that removes 1 word and some
  5388.      cycles.  The addressmode `(pc)' can be interpreted as a subgroup
  5389.      of `(bd,pc,xn)'. Because `(pc)' is a normal 68000 addressmode you
  5390.      should never switch off this optimizing method.
  5391.  
  5392.      +------------------------+--------------------+--------+
  5393.      |       Addressmode      |     Optimizing     | Option |
  5394.      +------------------------+--------------------+--------+
  5395.      +------------------------+--------------------+--------+
  5396.      |     move. l (pc),dn    |   move.l (pc),dn   |  -OC7  |
  5397.      +------------------------+--------------------+--------+
  5398.  
  5399. Address Optimizing
  5400. ------------------
  5401.  
  5402.    * `Long'
  5403.  
  5404.      +---------------+----------------+---------------------+--------+
  5405.      | Addressmode   |   Optimizing   |         Note        | Option |
  5406.      +---------------+----------------+---------------------+--------+
  5407.      +---------------+----------------+---------------------+--------+
  5408.      |     x.l,EA    |    x.w,EA      | $ffff8000<=x<=$7fff |        |
  5409.      +---------------+----------------+---------------------+  -OAL  |
  5410.      |     EA,x.l    |    EA,x.l      | $ffff8000<=x<=$7fff |        |
  5411.      +---------------+----------------+---------------------+--------+
  5412.  
  5413.    * `x(an)'
  5414.  
  5415.      +---------------+----------------+---------------------+--------+
  5416.      | Addressmode   |   Optimizing   |         Note        | Option |
  5417.      +---------------+----------------+---------------------+--------+
  5418.      +---------------+----------------+---------------------+--------+
  5419.      |   x(an),EA    |    (an),EA     |         x=0         |        |
  5420.      +---------------+----------------+---------------------+  -OAX  |
  5421.      |   EA,x(an)    |    EA,(an)     |         x=0         |        |
  5422.      +---------------+----------------+---------------------+--------+
  5423.  
  5424.    * `PC-Relative'
  5425.  
  5426.      +---------------+----------------+---------------------+--------+
  5427.      | Addressmode   |   Optimizing   |         Note        | Option |
  5428.      +---------------+----------------+---------------------+--------+
  5429.      +---------------+----------------+---------------------+--------+
  5430.      |   label,EA    |  label(pc),EA  | $ffff8000<=x<=$7fff |  -OAP  |
  5431.      +---------------+----------------+---------------------+--------+
  5432.  
  5433.    * `A4-Smalldata'
  5434.  
  5435.      +---------------+----------------+---------------------+--------+
  5436.      | Addressmode   |   Optimizing   |         Note        | Option |
  5437.      +---------------+----------------+---------------------+--------+
  5438.      +---------------+----------------+---------------------+--------+
  5439.      |     x.l,EA    |    x(a4),EA    | $ffff8000<=x<=$7fff |        |
  5440.      +---------------+----------------+---------------------+  -OAS  |
  5441.      |     EA,x.l    |    EA,x(a4)    | $ffff8000<=x<=$7fff |        |
  5442.      +---------------+----------------+---------------------+--------+
  5443.  
  5444.    * `68020-An'
  5445.  
  5446.      +---------------+----------------+---------------------+--------+
  5447.      | Addressmode   |   Optimizing   |         Note        | Option |
  5448.      +---------------+----------------+---------------------+--------+
  5449.      +---------------+----------------+---------------------+--------+
  5450.      |   (x.l,an)    |    (an)        | x=0                 |  -OAY  |
  5451.      +---------------+----------------+---------------------+        |
  5452.      |   (x.l,an)    |    x(an)       | $ffffff80<=x<=$7f   |        |
  5453.      +---------------+----------------+---------------------+        |
  5454.      |   (x,an,xn)   |    0(an,xn)    | x=0                 |        |
  5455.      +---------------+----------------+---------------------+        |
  5456.      |   (x,an,xn)   |    (x.b,an,xn) | $ffffff80<=x<=$7f   |        |
  5457.      +---------------+----------------+---------------------+        |
  5458.      |   (x,an,xn)   |    (x.w,an,xn) | $ffff8000<=x<=$7fff |        |
  5459.      +---------------+----------------+---------------------+        |
  5460.      |   ([?],x)     |    ([?])       | x=0                 |        |
  5461.      |               |                | ? is also optimized |        |
  5462.      +---------------+----------------+---------------------+        |
  5463.      |   ([?],x)     |    ([?],x.w)   | $ffff8000<=x<=$7fff |        |
  5464.      |               |                | ? is also optimized |        |
  5465.      +---------------+----------------+---------------------+        |
  5466.      |   ([?],xn,x)  |    ([?],xn)    | x=0                 |        |
  5467.      |               |                | ? is also optimized |        |
  5468.      +---------------+----------------+---------------------+        |
  5469.      |   ([?],xn,x)  |    ([?],xn,x.w)| $ffff8000<=x<=$7fff |        |
  5470.      |               |                | ? is also optimized |        |
  5471.      +---------------+----------------+---------------------+--------+
  5472.  
  5473.    * `68020-PC'
  5474.  
  5475.      +---------------+----------------+---------------------+--------+
  5476.      | Addressmode   |   Optimizing   |         Note        | Option |
  5477.      +---------------+----------------+---------------------+--------+
  5478.      +---------------+----------------+---------------------+--------+
  5479.      |   (x.l,pc)    |    (pc)        | x=0                 |  -OAZ  |
  5480.      +---------------+----------------+---------------------+        |
  5481.      |   (x.l,pc)    |    x(pc)       | $ffffff80<=x<=$7f   |        |
  5482.      +---------------+----------------+---------------------+        |
  5483.      |   (x,pc,xn)   |    0(pc,xn)    | x=0                 |        |
  5484.      +---------------+----------------+---------------------+        |
  5485.      |   (x,pc,xn)   |    (x.b,pc,xn) | $ffffff80<=x<=$7f   |        |
  5486.      +---------------+----------------+---------------------+        |
  5487.      |   (x,pc,xn)   |    (x.w,pc,xn) | $ffff8000<=x<=$7fff |        |
  5488.      +---------------+----------------+---------------------+        |
  5489.      |   ([?],x)     |    ([?])       | x=0                 |        |
  5490.      |               |                | ? is also optimized |        |
  5491.      +---------------+----------------+---------------------+        |
  5492.      |   ([?],x)     |    ([?],x.w)   | $ffff8000<=x<=$7fff |        |
  5493.      |               |                | ? is also optimized |        |
  5494.      +---------------+----------------+---------------------+        |
  5495.      |   ([?],xn,x)  |    ([?],xn)    | x=0                 |        |
  5496.      |               |                | ? is also optimized |        |
  5497.      +---------------+----------------+---------------------+        |
  5498.      |   ([?],xn,x)  |    ([?],xn,x.w)| $ffff8000<=x<=$7fff |        |
  5499.      |               |                | ? is also optimized |        |
  5500.      +---------------+----------------+---------------------+--------+
  5501.  
  5502. #x Optimizing
  5503. -------------
  5504.  
  5505.    * `Move'
  5506.  
  5507.      +-------------------+------------------+-------------------------+--------+
  5508.      | Addressmode       |   Optimizing     |         Note            | Option |
  5509.      +-------------------+------------------+-------------------------+--------+
  5510.      |                   |                  |                         |  -OD0  |
  5511.      +-------------------+------------------+-------------------------+--------+
  5512.      |  move.l #x,dn     |   moveq #x,dn    |    $ffffff80<=$7f       |  -OD00 |
  5513.      +-------------------+------------------+-------------------------+        |
  5514.      |  move.? #0,an     |  suba.l an,an    |      ? = w or l         |  -OD01 |
  5515.      +-------------------+------------------+-------------------------+        |
  5516.      |  move.l #x,dn     | moveq #y,dn      | $10000<=x<=$7f0000      |  -OD02 |
  5517.      |                   | swap dn          |                         |        |
  5518.      +-------------------+------------------+-------------------------+        |
  5519.      |  move.l #x,dn     | moveq #y,dn      | $ff80ffff<=x<=$fffEffff |  -OD03 |
  5520.      |                   | swap dn          |                         |        |
  5521.      +-------------------+------------------+-------------------------+        |
  5522.      |  move.l #x,dn     | moveq #y,dn      |      $80<=x<=$ff        |  -OD04 |
  5523.      |                   | not.b dn         |                         |        |
  5524.      +-------------------+------------------+-------------------------+        |
  5525.      |  move.l #x,dn     | moveq #y,dn      |     $ffff<=x<=$ff81     |  -OD05 |
  5526.      |                   | neg.w dn         |                         |        |
  5527.      +-------------------+------------------+-------------------------+        |
  5528.      |  move.l #x,dn     | moveq #y,dn      | $ffff0080<=x<=$ffff0001 |  -OD06 |
  5529.      |                   | neg.w dn         |                         |        |
  5530.      +-------------------+------------------+-------------------------+        |
  5531.      |  move.? #0,EA     | clr.? EA         | ? = w or l.See Trashreg |  -OD07 |
  5532.      |                   |                  | optimizing. I also check|        |
  5533.      |                   |                  | if it accesses the HW   |        |
  5534.      +-------------------+------------------+-------------------------+        |
  5535.      | move.b #$ff,EA    | st EA            |                         |  -OD08 |
  5536.      +-------------------+------------------+-------------------------+        |
  5537.      | movea.l -4(an),an | movea.l -(an),an |                         |  -OD09 |
  5538.      +-------------------+------------------+-------------------------+        |
  5539.      | movea.w -2(an),an | movea.w -(an),an |                         |  -OD0a |
  5540.      +-------------------+------------------+-------------------------+--------+
  5541.  
  5542.    * `Clr'
  5543.  
  5544.      +---------------+----------------+-------------------------+--------+
  5545.      | Addressmode   |   Optimizing   |         Note            | Option |
  5546.      +---------------+----------------+-------------------------+--------+
  5547.      +---------------+----------------+-------------------------+--------+
  5548.      |    clr.l dn   |   moveq #0,dn  |                         |  -OD1  |
  5549.      +---------------+----------------+-------------------------+--------+
  5550.  
  5551.    * `Add'
  5552.  
  5553.      +---------------+----------------+-------------------------+--------+
  5554.      | Addressmode   |   Optimizing   |         Note            | Option |
  5555.      +---------------+----------------+-------------------------+--------+
  5556.      +---------------+----------------+-------------------------+--------+
  5557.      |  add.? #x,EA  |  addq.? #x,EA  |       1<=x<=8           |  -OD2  |
  5558.      +---------------+----------------+-------------------------+        |
  5559.      |  add.? #x,EA  |  subq.? #x,EA  |      -8<=x<=-1          |        |
  5560.      +---------------+----------------+-------------------------+        |
  5561.      |  add.? #x,an  | lea.l x(an),an |   $ffff8000<=x<=$7fff   |        |
  5562.      +---------------+----------------+-------------------------+        |
  5563.      |  add.? #0,EA  | tst.? EA       |       legal EA          |        |
  5564.      +---------------+----------------+-------------------------+        |
  5565.      |  add.? #0,an  | removed        |                         |        |
  5566.      +---------------+----------------+-------------------------+--------+
  5567.  
  5568.    * `Sub'
  5569.  
  5570.      +---------------+----------------+-------------------------+--------+
  5571.      | Addressmode   |   Optimizing   |         Note            | Option |
  5572.      +---------------+----------------+-------------------------+--------+
  5573.      +---------------+----------------+-------------------------+--------+
  5574.      |  sub.? #x,EA  |  subq.? #x,EA  |       1<=x<=8           |  -OD3  |
  5575.      +---------------+----------------+-------------------------+        |
  5576.      |  sub.? #x,EA  |  addq.? #x,EA  |      -8<=x<=-1          |        |
  5577.      +---------------+----------------+-------------------------+        |
  5578.      |  sub.? #x,an  |lea.l -x(an),an |   $ffff8000<=x<=$7fff   |        |
  5579.      +---------------+----------------+-------------------------+        |
  5580.      |  sub.? #0,EA  | tst.? EA       |       legal EA          |        |
  5581.      +---------------+----------------+-------------------------+        |
  5582.      |  sub.? #0,an  | removed        |                         |        |
  5583.      +---------------+----------------+-------------------------+--------+
  5584.  
  5585.    * `Lea'
  5586.  
  5587.      +---------------+----------------+-------------------------+--------+
  5588.      | Addressmode   |   Optimizing   |         Note            | Option |
  5589.      +---------------+----------------+-------------------------+--------+
  5590.      +---------------+----------------+-------------------------+--------+
  5591.      | lea x(an),an  |  addq.w #x,an  |       1<=x<=8           |        |
  5592.      +---------------+----------------+-------------------------+  -OD4  |
  5593.      | lea x(an),an  |  subq.w #x,an  |      -8<=x<=-1          |        |
  5594.      +---------------+----------------+-------------------------+--------+
  5595.  
  5596.    * `Cmp'
  5597.  
  5598.      +---------------+----------------+-------------------------+--------+
  5599.      | Addressmode   |   Optimizing   |         Note            | Option |
  5600.      +---------------+----------------+-------------------------+--------+
  5601.      +---------------+----------------+-------------------------+--------+
  5602.      |  cmp.? #0,EA  |   tst.? EA     |                         |  -OD5  |
  5603.      +---------------+----------------+-------------------------+--------+
  5604.  
  5605.    * `Bcc'
  5606.  
  5607.      The assembler tries to optimize the branch on the smallest
  5608.      possible length so that can win max 2 words and some cycles.
  5609.  
  5610.      +---------------+----------------+-------------------------+--------+
  5611.      | Addressmode   |   Optimizing   |         Note            | Option |
  5612.      +---------------+----------------+-------------------------+--------+
  5613.      +---------------+----------------+-------------------------+--------+
  5614.      |  Bcc.l label  |  Bcc.w label   |   $8000<=label<=$7fff   |  -OD6  |
  5615.      +---------------+----------------+-------------------------+        |
  5616.      |  Bcc.l label  |  Bcc.s label   |     $80<=label<=$7f     |        |
  5617.      +---------------+----------------+-------------------------+        |
  5618.      |  Bcc.w label  |  Bcc.s label   |     $80<=label<=$7f     |        |
  5619.      +---------------+----------------+-------------------------+--------+
  5620.  
  5621.      Attention! This optimizing methid is unsafe when you use
  5622.      BRANCH-Tables.  You should switch off the optimize method over
  5623.      this area.
  5624.  
  5625.  
  5626.    * `Jsr'
  5627.  
  5628.      +---------------+----------------+-------------------------+--------+
  5629.      | Addressmode   |   Optimizing   |         Note            | Option |
  5630.      +---------------+----------------+-------------------------+--------+
  5631.      +---------------+----------------+-------------------------+--------+
  5632.      |   jsr label   |  bsr.w label   |   $8000<=Offset<=$7fff  |        |
  5633.      +---------------+----------------+-------------------------+  -OD7  |
  5634.      |   jsr label   |  bsr.s label   |     $80<=Offset<=$7f    |        |
  5635.      +---------------+----------------+-------------------------+--------+
  5636.  
  5637.      Attention! This optimizing methid is unsafe when you use
  5638.      JSR-Tables.  You should switch off the optimize method over this
  5639.      area.
  5640.  
  5641.  
  5642.    * `Jmp'
  5643.  
  5644.      +---------------+----------------+-------------------------+--------+
  5645.      | Addressmode   |   Optimizing   |         Note            | Option |
  5646.      +---------------+----------------+-------------------------+--------+
  5647.      +---------------+----------------+-------------------------+--------+
  5648.      |   jmp label   |  bra.w label   |$ffff8000<=Offset<=$7fff |        |
  5649.      +---------------+----------------+-------------------------+  -OD8  |
  5650.      |   jmp label   |  bra.s label   |$ffffff80<=Offset<=$7f   |        |
  5651.      +---------------+----------------+-------------------------+--------+
  5652.  
  5653.    * `Asl'
  5654.  
  5655.      +---------------+----------------+-------------------------+--------+
  5656.      | Addressmode   |   Optimizing   |         Note            | Option |
  5657.      +---------------+----------------+-------------------------+--------+
  5658.      +---------------+----------------+-------------------------+--------+
  5659.      |  asl.? #1,dn  |  add.? dn,dn   |                         |  -OD9  |
  5660.      +---------------+----------------+-------------------------+--------+
  5661.  
  5662.    * `Or' This optimizing method isn't safe because of the changed
  5663.      condition flags.
  5664.  
  5665.      +---------------+----------------+-------------------------+--------+
  5666.      | Addressmode   |   Optimizing   |         Note            | Option |
  5667.      +---------------+----------------+-------------------------+--------+
  5668.      +---------------+----------------+-------------------------+--------+
  5669.      |  or.? #x,dn   |  bset #y,dn    | x=y^2                   |  -ODa  |
  5670.      +---------------+----------------+-------------------------+--------+
  5671.  
  5672.    * `Eor' This optimizing method isn't safe because of the changed
  5673.      condition flags.
  5674.  
  5675.      +---------------+----------------+-------------------------+--------+
  5676.      | Addressmode   |   Optimizing   |         Note            | Option |
  5677.      +---------------+----------------+-------------------------+--------+
  5678.      +---------------+----------------+-------------------------+--------+
  5679.      |  eor.? #x,dn  |  bchg #y,dn    | x=y^2                   |  -ODb  |
  5680.      +---------------+----------------+-------------------------+--------+
  5681.  
  5682.    * `Mulu'
  5683.  
  5684.      Be very careful with this optimizing.
  5685.  
  5686.      +---------------+----------------+-------------------------+--------+
  5687.      | Addressmode   |   Optimizing   |         Note            | Option |
  5688.      +---------------+----------------+-------------------------+--------+
  5689.      +---------------+----------------+-------------------------+--------+
  5690.      | mulu.w #x,dn  | swap dn        | x=2^y                   |  -ODc  |
  5691.      |               | clr.w dn       | y=y1+y2                 |        |
  5692.      |               | swap dn        | y=1,add.l dn,dn         |        |
  5693.      |               | lsl.l #y1,dn   |                         |        |
  5694.      |               | lsl.l #y2,dn   |                         |        |
  5695.      +---------------+----------------+-------------------------+        |
  5696.      | mulu.l #x,dn  | lsl.l #y1,dn   | x=2^y                   |        |
  5697.      |               | lsl.l #y2,dn   | y=y1+y2                 |        |
  5698.      |               |                | y >= 16                 |        |
  5699.      |               |                | swap dn , y-16          |        |
  5700.      +---------------+----------------+-------------------------+--------+
  5701.  
  5702.    * `Muls'
  5703.  
  5704.      Be very careful with this optimizing.
  5705.  
  5706.      +---------------+----------------+-------------------------+--------+
  5707.      | Addressmode   |   Optimizing   |         Note            | Option |
  5708.      +---------------+----------------+-------------------------+--------+
  5709.      +---------------+----------------+-------------------------+--------+
  5710.      | muls.w #x,dn  | ext.l dn       | x=2^y                   |  -ODd  |
  5711.      |               | asl.l #y1,dn   | y=y1+y2                 |        |
  5712.      |               | asl.l #y2,dn   | y=1 , add.l dn,dn       |        |
  5713.      +---------------+----------------+-------------------------+        |
  5714.      | muls.l #x,dn  | asl.l #y1,dn   | x=2^y                   |        |
  5715.      |               | asl.l #y2,dn   | y=y1+y2                 |        |
  5716.      |               |                | y >= 16                 |        |
  5717.      |               |                | swap dn ,y-16           |        |
  5718.      +---------------+----------------+-------------------------+--------+
  5719.  
  5720.    * `Jsr+Rts'
  5721.  
  5722.      +--------------+---------------+------------------------+-------+
  5723.      | Addressmode   |   Optimizing   |         Note            |
  5724.      Option |
  5725.      +--------------+---------------+------------------------+-------+
  5726.      +--------------+---------------+------------------------+-------+
  5727.      | jsr EA        | jmp EA         | No optimizing if there's|  -ODe
  5728.      | | rts           |                | a label before RTS      |
  5729.         |
  5730.      +--------------+---------------+------------------------+-------+
  5731.  
  5732.    * `Bsr+Rts'
  5733.  
  5734.      +--------------+---------------+------------------------+-------+
  5735.      | Addressmode   |   Optimizing   |         Note            |
  5736.      Option |
  5737.      +--------------+---------------+------------------------+-------+
  5738.      +--------------+---------------+------------------------+-------+
  5739.      | jmp EA        | jmp EA         | No optimizing if there's|  -ODf
  5740.      | | rts           |                | a label before RTS      |
  5741.         |
  5742.      +--------------+---------------+------------------------+-------+
  5743.  
  5744.    * `MovemNoRegister'
  5745.  
  5746.      +---------------+----------------+-------------------------+--------+
  5747.      | Addressmode   |   Optimizing   |         Note            | Option |
  5748.      +---------------+----------------+-------------------------+--------+
  5749.      +---------------+----------------+-------------------------+--------+
  5750.      |  movem.l ,EA  |     Removed    |                         |        |
  5751.      +---------------+----------------+-------------------------+  -ODh  |
  5752.      |  movem.l EA,  |     Removed    |                         |        |
  5753.      +---------------+----------------+-------------------------+--------+
  5754.  
  5755.    * `MovemOneRegister'
  5756.  
  5757.      +---------------+----------------+-------------------------+--------+
  5758.      | Addressmode   |   Optimizing   |         Note            | Option |
  5759.      +---------------+----------------+-------------------------+--------+
  5760.      +---------------+----------------+-------------------------+--------+
  5761.      | movem.l Xn,EA |  Move.l Xn,EA  | Alter the status flags! |        |
  5762.      +---------------+----------------+-------------------------+  -ODi  |
  5763.      | movem.l EA,Xn |  Move.l EA,Xn  | Alter the status flags! |        |
  5764.      +---------------+----------------+-------------------------+--------+
  5765.  
  5766. Register Optimizing
  5767. -------------------
  5768.  
  5769.    * `#xxx' is switched off.
  5770.  
  5771.         * An address register is set free by `trashreg'.
  5772.  
  5773.           +---------------+--------------------+-------------------------+--------+
  5774.           | Addressmode   |   Optimizing       |         Note            | Option |
  5775.           +---------------+--------------------+-------------------------+--------+
  5776.           +---------------+--------------------+-------------------------+--------+
  5777.           |move.? EA,label| lea.l label(pc),an | $ffff8000<=label<=$7fff |        |
  5778.           |               | move.? EA,(an)     |                         |  -OAR  |
  5779.           +---------------+--------------------+-------------------------+        |
  5780.           |  tst.?  label | lea.l label(pc),an | $ffff8000<=label<=$7fff |        |
  5781.           |               | tst.? (an)         |                         |        |
  5782.           +---------------+--------------------+-------------------------+        |
  5783.           |  not.?  label | lea.l label(pc),an | $ffff8000<=label<=$7fff |        |
  5784.           |               | not.? (an)         |                         |        |
  5785.           +---------------+--------------------+-------------------------+        |
  5786.           |  neg.?  label | lea.l label(pc),an | $ffff8000<=label<=$7fff |        |
  5787.           |               | neg.? (an)         |                         |        |
  5788.           +---------------+--------------------+-------------------------+        |
  5789.           |  negx.? label | lea.l label(pc),an | $ffff8000<=label<=$7fff |        |
  5790.           |               | negx.? (an)        |                         |        |
  5791.           +---------------+--------------------+-------------------------+        |
  5792.           |  nbcd label   | lea.l label(pc),an | $ffff8000<=label<=$7fff |        |
  5793.           |               | nbcd (an)          |                         |        |
  5794.           +---------------+--------------------+-------------------------+        |
  5795.           |   scc label   | lea.l label(pc),an | $ffff8000<=label<=$7fff |        |
  5796.           |               | scc (an)           |                         |        |
  5797.           +---------------+--------------------+-------------------------+--------+
  5798.  
  5799.    * `#x' Optimizing on.
  5800.  
  5801.         * A data register is set free by `trashreg'.
  5802.  
  5803.           +---------------+--------------------+-------------------------+--------+
  5804.           | Addressmode   |   Optimizing       |         Note            | Option |
  5805.           +---------------+--------------------+-------------------------+--------+
  5806.           +---------------+--------------------+-------------------------+--------+
  5807.           | move.l #x,EA  | moveq  #x,dn       |    $ffffff80<=x<=$7f    |        |
  5808.           |               | move.l dn,EA       |                         |  -OAR  |
  5809.           +---------------+--------------------+-------------------------+        |
  5810.           | ori.l  #x,EA  | moveq  #x,dn       |    $ffffff80<=x<=$7f    |        |
  5811.           |               | or.l   dn,EA       |                         |        |
  5812.           +---------------+--------------------+-------------------------+        |
  5813.           | eori.l #x,EA  | moveq  #x,dn       |    $ffffff80<=x<=$7f    |        |
  5814.           |               | eor.l  dn,EA       |                         |        |
  5815.           +---------------+--------------------+-------------------------+        |
  5816.           | andi.l #x,EA  | moveq  #x,dn       |    $ffffff80<=x<=$7f    |        |
  5817.           |               | and.l  dn,EA       |                         |        |
  5818.           +---------------+--------------------+-------------------------+        |
  5819.           | addi.l #x,EA  | moveq  #x,dn       |    $ffffff80<=x<=$7f    |        |
  5820.           |               | add.l  dn,EA       |                         |        |
  5821.           +---------------+--------------------+-------------------------+        |
  5822.           | subi.l #x,EA  | moveq  #x,dn       |    $ffffff80<=x<=$7f    |        |
  5823.           |               | sub.l  dn,EA       |                         |        |
  5824.           +---------------+--------------------+-------------------------+        |
  5825.           | cmpi.l #x,EA  | moveq  #x,dn       |    $ffffff80<=x<=$7f    |        |
  5826.           |               | cmp.l  EA,dn       |                         |        |
  5827.           +---------------+--------------------+-------------------------+        |
  5828.           | move.? #0,EA  | moveq  #0,dn       | Time optimizing         |        |
  5829.           |               | move.l dn,EA       | must be on              |        |
  5830.           +---------------+--------------------+-------------------------+--------+
  5831.  
  5832. How does Optimizing work ?
  5833. --------------------------
  5834.  
  5835.    In single-pass Optimizing the assembler can only optimize commands
  5836. where it can resolve the reference in the first pass.  This means the
  5837. label or symbol has to be known before.  In multi-pass Optimizing it
  5838. can optimize every command without bothering where the label is defined.
  5839. The Assembler keeps all labels each pass but increases a change counter
  5840. if the old contents differs with the new contents.  The exception is
  5841. that the assembler can't optimize commands that depend on symbols that
  5842. are defined after the command.  The reason is that the Assembler has to
  5843. remove each pass every symbol to avoid problems with `IFD' and `IFND'
  5844. that can cause that certain areas aren't assembled in multi-pass mode.
  5845. You probably noticed that i assume that nobody used `IFD' or `IFND'
  5846. with labels because that would also break multi-pass.
  5847.  
  5848.    An example for a construct that can't be optimized.
  5849.  
  5850.           move.l #1,NULL(a0)
  5851.      NULL=0
  5852.  
  5853. Problems...
  5854. -----------
  5855.  
  5856.    You should always be careful with optimizing because it can cause
  5857. bugs in certain source areas.  Branch optimizing for example has to be
  5858. switched off if you use JMP-Towers.
  5859.  
  5860.  
  5861.           lsl.w #1,d0
  5862.           jmp   Tower(pc,d0.w)
  5863.      
  5864.       Tower:
  5865.           bra.w func1
  5866.           bra.w func2
  5867.           bra.w func3
  5868.      
  5869.       could be be optimized to
  5870.      
  5871.       Tower:
  5872.           bra.w func1
  5873.           bra.s func2
  5874.           bra.s func3
  5875.      
  5876.       that leads to program bugs.
  5877.      
  5878.       Solution:
  5879.      
  5880.       bopt OD6-
  5881.      
  5882.       Tower:
  5883.           bra.w func1
  5884.           bra.w func2
  5885.           bra.w func3
  5886.      
  5887.       bopt OD6+
  5888.  
  5889. Preassembled Includes
  5890. =====================
  5891.  
  5892.    If you want to assemble a program that needs to load a lot includes
  5893. it's useful to preassemble the includes and load one file because  the
  5894. real slowdown factor is the need loading time.   You can only use
  5895. absolut symbols and macros in a preassembled file.   All relative and
  5896. symbols defined by `set' aren't written into  a preassembled file.
  5897. The created file isn't compress to avoid any slowdown but if  the file
  5898. size is critical you can compress the file by xpk and  load it through
  5899. the xfh filesystem.
  5900.  
  5901.      basm -p Source.S creates the preassembled file Source.p
  5902.  
  5903.  
  5904.      An error location could be absolut symbols that are calculated  by
  5905.      relative symbols. You should avoid these symbols.
  5906.  
  5907.      Symbol=Label1-Label2
  5908.  
  5909.  
  5910. Resident includes
  5911. =================
  5912.  
  5913.    `BASM' can control an Include and Incbin database by the library
  5914. `cachefile.library' to get rid of the loading delays.  The files in the
  5915. database can be shown and deleted.
  5916.  
  5917. Basm Assembler System
  5918. =====================
  5919.  
  5920. Cli Calling Convention
  5921. ----------------------
  5922.  
  5923.    `Format:'
  5924.  
  5925.      BASM [-Option] Name
  5926.  
  5927.  
  5928.    This is the commandline version of the assembler and can be easy
  5929. integrated in own development system, for example `Make' and `CED'.  An
  5930. assembler error is indicated by the result 20 and the result 10 is used
  5931. if no source file were specified.
  5932.  
  5933.    * `Option'
  5934.  
  5935.      The same options are accepted that are described in the assembler
  5936.      command *Note BOPT: MI_BOPT.  The following options are accepted
  5937.      additionally.
  5938.  
  5939.         * A[+,-] Turns ARexx mode on/off
  5940.  
  5941.         * C <Configuration> loads a configuration file
  5942.  
  5943.         * d <Symbol=Value> defines a symbol
  5944.  
  5945.    * `Standard-Optionen'
  5946.  
  5947.  
  5948.           ;All other options are deactivated.
  5949.           
  5950.           c+,e+,m1000,wo+,ws+,wm+,w2+,w4+,wp+
  5951.           b1+,B0+,n1+
  5952.           OC0+,OC1+,OC2+,OC3+,OC4+,OC5+,OC6+,OC7+,
  5953.           ODD+,OD0+,OD1+,OD2+,OD3+,OD4+,OD5+,OD6+,OD7+,OD8+,
  5954.           OD9+,ODc+,ODe+,ODf+,ODg+
  5955.           OAP+,OAL+,OAX+,OAY+,OAZ+,OAR+
  5956.  
  5957. Configuration
  5958. -------------
  5959.  
  5960. Global
  5961. ......
  5962.  
  5963.    You can define the global configuration through the file
  5964. `ENV:BASMOption'. The internal standard configuration  is not replaced
  5965. but can only be changed.
  5966.  
  5967.    File `ENV:BASMOption'
  5968.  
  5969.  
  5970.       -v
  5971.       -f
  5972.       -c-
  5973.       -iASM:
  5974.  
  5975.      If a line doesn't start with - it's ignored.
  5976.  
  5977.  
  5978. WB Tooltypes
  5979. ............
  5980.  
  5981.    Additionally you can also define the above described configuration
  5982. options in the tooltypes of the source file icon.   Furthermore `BASM'
  5983. allows a special tooltype to define  an output window.
  5984.  
  5985.    o Window= <Window Defintion>
  5986.  
  5987. ARexx
  5988. =====
  5989.  
  5990.    The `BASM' ARexx Port Name is `rexx_BASM' and the  ARexx Script
  5991. suffix `.basm'.   To activate the `BASM' ARexx mode you have to start
  5992. `BASM' with the option -A.
  5993.  
  5994. BASM
  5995. ....
  5996.  
  5997.    `BASM [-Option] Name'
  5998.  
  5999.    This ARexx command starts the assembler and coincides with the
  6000. CLI-syntax structure.
  6001.  
  6002. BEND
  6003. ....
  6004.  
  6005.    `BEND'
  6006.  
  6007.    This ARexx command closes the ARexx port and shuts down the
  6008. assembler.
  6009.  
  6010. BGETERROR
  6011. .........
  6012.  
  6013.    `BGETERROR'
  6014.  
  6015.    With this ARexx command you will receive an explanation of the actual
  6016. errors. If no errors exist it will return a status code 20.
  6017.  
  6018.    Error Format String
  6019.  
  6020.    OFFSET|FILE|<Error Description>
  6021.  
  6022. BNEXTERROR
  6023. ..........
  6024.  
  6025.    `BNEXTERROR'
  6026.  
  6027.    This ARexx command will cause a jump to the next error in the list.
  6028. If there are no further errors in the list it will return a status
  6029. code 20.
  6030.  
  6031. BINITERROR
  6032. ..........
  6033.  
  6034.    `BINITERROR'
  6035.  
  6036.    This ARexx command will cause a jump to the first entry in the error
  6037. list. If no error exists it will return a status code 20.
  6038.  
  6039. BGETWARNING
  6040. ...........
  6041.  
  6042.    `BGETWARNING'
  6043.  
  6044.    works like `BGETERROR' only for Warnings.
  6045.  
  6046. BNEXTWARNING
  6047. ............
  6048.  
  6049.    `BNEXTWARNING'
  6050.  
  6051.    works like `BNEXTERROR' only for Warnings.
  6052.  
  6053. BINITWARNING
  6054. ............
  6055.  
  6056.    `BINITWARNING'
  6057.  
  6058.    works like `BINITERROR' only for Warnings.
  6059.  
  6060. Compatibility
  6061. =============
  6062.  
  6063. to other assemblers...
  6064. ----------------------
  6065.  
  6066.  
  6067.      Unfortunately `BASM' can't be 100% compatible to every assembler
  6068.      on the amiga market.  Thus you can expect problems with different
  6069.      sources.  In general you can expect problems with commands that
  6070.      don't belong to a standard like option commands.  Furthermore you
  6071.      should also be careful with sources that directly depend on the
  6072.      assembler implementation.  Because `BASM' is a 1-Pass Assembler in
  6073.      the normal mode with an additional backpatch phase you shouldn't
  6074.      define symbols that can't be resolved at once.  An ideal example
  6075.      for this practice is the `Xoper2.2' Source that was developed with
  6076.      the PD Assembler A68k.  While assembling with `BASM' the assembler
  6077.      detects that a not defined symbols is accessed through the `SET'
  6078.      command.  Generally this should cause an error at once but
  6079.      unfortunately `A68k' doesn't show anything and uses the last value
  6080.      of `cmdnum'.
  6081.  
  6082.  
  6083.  
  6084.           ADDCMD        MACRO
  6085.           cmdnum        set     cmdnum+1
  6086.                   dc.b    \1,0
  6087.                   ENDM
  6088.                       .
  6089.                       .
  6090.                       .
  6091.           ;Here it's using `cmdnum' although
  6092.           ;the symbol wasn't defined yet
  6093.                   addq    #1,d2
  6094.                   cmp.w   #cmdnum,d2
  6095.                   bne.s   1$
  6096.                       .
  6097.                       .
  6098.                       .
  6099.           
  6100.           ;Here the cmdnum is first defined
  6101.           cmdnum        set      0
  6102.           commds        ADDCMD  'time'
  6103.                   ADDCMD  'taskpri'
  6104.                   ADDCMD  'info'
  6105.                   ADDCMD  'pri'
  6106.                   ADDCMD  'flush'
  6107.  
  6108.      Because the A68k is a 2-Pass Assembler he can assemble this Source
  6109.      without problems.
  6110.  
  6111.  
  6112.      Another Problem is that the assembler argument parser doesn't
  6113.      detect Overflow because of speed reasons. I don't think it's worth
  6114.      it...if you differ tell me your opinion.
  6115.  
  6116.  
  6117.      The assembler doesn't support the following motorola syntax bugs
  6118.      because of the internal structure of the parser it would cause
  6119.      major problems in the multi-pass mode.
  6120.  
  6121.  
  6122.           symbol: equ 0
  6123.           symbol: equr d0
  6124.  
  6125. C-Compiler Assembler
  6126. --------------------
  6127.  
  6128. Dice
  6129. ....
  6130.  
  6131.    If you use Basm as a `DASM' replacement you have to run `Basm' with
  6132. the option -OAS to activate the Smalldata mode.  If you want to emulate
  6133. the advanced `Link', `UnLink', `Movem' optimizing `DASM' supports you
  6134. have to use the options -O, -OG, -ODh, -ODi and -ODj.  The option -OG
  6135. is needed because the link stackframe register list symbols are defined
  6136. after the commands so the assembler doesn't know them in 1 pass mode.
  6137. Sorry...i had to disable this mode because i later detected that i have
  6138. to keep track of the used registers.  I'll try to fix this in a later
  6139. version
  6140.  
  6141. Literature
  6142. **********
  6143.  
  6144.    * [Addison Wesley] RKM Libraries 2.04,CATS
  6145.  
  6146.    * [Addison Wesley] RKM Devices 2.04,CATS
  6147.  
  6148.    * [Addison Wesley] RKM Autodocs\&Includes 2.04,CATS
  6149.  
  6150.    * [Addison Wesley] RKM Hardware 2.04,CATS
  6151.  
  6152.    * [Addison Wesley] RKM Styleguide,CATS
  6153.  
  6154.    * [Addison Wesley] RKM Libraries 1.1,CATS
  6155.  
  6156.    * [Addison Wesley] RKM Intuition 1.1,CATS
  6157.  
  6158.    * [Addison Wesley] RKM Exec 1.1,CATS
  6159.  
  6160.    * [Addison Wesley] RKM Hardware 1.1,CATS
  6161.  
  6162.    * [Edotronik] Kommentiertes Rom-Listing 1,Dr. Ruprecht
  6163.  
  6164.    * [Edotronik] Kommentiertes Rom-Listing 2,Dr. Ruprecht
  6165.  
  6166.    * [Edotronik] Kommentiertes Rom-Listing 3,Dr. Ruprecht
  6167.  
  6168.    * [Ralph Babel] Guru Book,Selbstvertrieb
  6169.  
  6170. Software
  6171. ********
  6172.  
  6173.    For the development of Barfly the following programs were used:
  6174.  
  6175.    * [CATS] Developer CD V2.0
  6176.  
  6177.    * [B.Hawes] WShell V2.0
  6178.  
  6179.    * [M.Sinz] Enforcer
  6180.  
  6181.    * [R.Schmidt] CyberGuard
  6182.  
  6183.    * [C.Scheppner] Mungwall
  6184.  
  6185.    * [SAS Institute] SAS/C
  6186.  
  6187.    * [GNU] GCC
  6188.  
  6189.    * [ASDG] CED
  6190.  
  6191.    * [Georg Hessmann] PasTex
  6192.  
  6193.    * [Stefan Stuntz] MFR 2.0d
  6194.  
  6195.    * [Mathias Scheler] Filer
  6196.  
  6197.    * [Matthew Dillon] DNet
  6198.  
  6199.    * [Brian Cerveny] Grapevine
  6200.  
  6201.    * [Ezy] MLink
  6202.  
  6203. Assembler Addressmodes
  6204. **********************
  6205.  
  6206.      +--------------+------------------------+
  6207.      |   Notation   | Description            |
  6208.      +--------------+------------------------+
  6209.      +--------------+------------------------+
  6210.      |      EA      | Effective Address      |
  6211.      |      Dn      | D0...D7                |
  6212.      |      An      | A0...A7                |
  6213.      |      Xn      | D0...D7, A0...A7       |
  6214.      |      .b      | Operand Width  8Bit    |
  6215.      |      .w      | Operand Width 16Bit    |
  6216.      |      .l      | Operand Width 32Bit    |
  6217.      |     size     | w,l                    |
  6218.      |     Size     | b,w,l                  |
  6219.      |     Scale    | 1,2,4 or 8             |
  6220.      | Xn.size*Scale| 68000-10 only Scale 1. |
  6221.      +---------------------------------------+
  6222.  
  6223. `Data register direct'
  6224.      Syntax: Dn
  6225.  
  6226. `Address register direct'
  6227.      Syntax: An
  6228.  
  6229. `Address register indirect'
  6230.      Syntax: (An)
  6231.  
  6232. `Address register indirect with postincrement'
  6233.      Syntax: (An)+
  6234.  
  6235. `Address register indirect with predecrement'
  6236.      Syntax: -(An)
  6237.  
  6238. `Address register indirect with offset'
  6239.      Syntax: bd.w(An)
  6240.  
  6241. `Address register indirect with index and offset'
  6242.      Syntax: bd.b(An,Xn{.Size*Scale})
  6243.  
  6244. `Address register indirect with index and offset'
  6245.      Syntax: (bd,An,Xn{.Size*Scale})
  6246.  
  6247. `Address register indirect with index and offset'
  6248.      Syntax: (bd.b,An,Xn{.Size*Scale})
  6249.  
  6250. `Address register indirect with index and base displacement'
  6251.      Syntax: ({bd.size{,An{,Xn{.Size{*Scale}}}}})
  6252.  
  6253. `Indirect Memory Addressierung mit postindex'
  6254.      Syntax: ({[{bd.size{,An}}]}{Xn{.Size{*Scale}{,od.size}}})
  6255.  
  6256. `Indirect Memory Addressierung mit preindex'
  6257.      Syntax: ({[{bd.size{,An}}{,Xn{.Size{*Scale}]}{,od.size}}})
  6258.  
  6259. `PC Indirect'
  6260.      Syntax: (PC)
  6261.  
  6262. `PC Indirect with offset'
  6263.      Syntax: bd.w(PC)
  6264.  
  6265. `PC Indirect with index and offset'
  6266.      Syntax: bd.b(PC,Xn{.Size*Scale})
  6267.  
  6268. `PC Indirect with index and offset'
  6269.      Syntax: bd.b(ZPC,Xn{.Size*Scale})
  6270.  
  6271. `PC Indirect with index and base displacement'
  6272.      Syntax: ({bd.size{,PC{,Xn{.Size{*Scale}}}}})
  6273.  
  6274. `PC Indirect with index and base displacement'
  6275.      Syntax: ({bd.size{,ZPC{,Xn{.Size{*Scale}}}}})
  6276.  
  6277. `PC Indirect memory Addressing with post-index'
  6278.      Syntax: ({[{bd.size{,PC}}]}{,Xn{.Size{*Scale}{,od.size}}})
  6279.  
  6280. `PC Indirect memory Addressing with post-index'
  6281.      Syntax: ({[{bd.size{,ZPC}}]}{,Xn{.Size{*Scale}{,od.size}}})
  6282.  
  6283. `PC Indirect memory Addressing with pre-index'
  6284.      Syntax: ({[{bd.size{,PC}}{,Xn{.Size{*Scale}]}{,od.size}}})
  6285.  
  6286. `PC Indirect memory addressing with pre-index'
  6287.      Syntax: ({[{bd.size{,ZPC}}{,Xn{.Size{*Scale}]}{,od.size}}})
  6288.  
  6289. `Absolut short'
  6290.      Syntax: bd.w
  6291.  
  6292. `Absolut long'
  6293.      Syntax: bd[.l]
  6294.  
  6295. `Immediate Data'
  6296.      Syntax: #xxx
  6297.  
  6298. Addressmode Examples
  6299. ====================
  6300.  
  6301.    To avoid some problems here are some small examples how addressmode
  6302. have to build up.
  6303.  
  6304.  
  6305.      x=$40
  6306.      y=$400
  6307.        move.b (x,A0,D2.W),D0
  6308.        move.b x(A0,D2.W),D0
  6309.      
  6310.      ;Both lines are correct
  6311.      ;(x,a0,d2.w) is optimized internal to (x,a0,d2.w).
  6312.      ;For more information please check the chapter about
  6313.      ;Optimizing Direct Addressmodes.
  6314.      
  6315.        move.b (y,A0,D2.W),D0
  6316.        move.b y(A0,D2.W),D0
  6317.      
  6318.      ;Now you get 2 errors, because y is not an 8bit word.
  6319.      ;These 2 lines shows the correct version.
  6320.      
  6321.        move.b (y.w,A0,D2.W),D0
  6322.        move.b (y.w,A0,D2.W),D0
  6323.      
  6324.      ;or
  6325.      
  6326.        move.b (y.l,A0,D2.W),D0
  6327.        move.b (y.l,A0,D2.W),D0
  6328.  
  6329. 680xx Opcode Overview
  6330. *********************
  6331.  
  6332.      +----------+---------+-------------------------------------------+
  6333.      |  Opcode  |  Size   | 68000 68010 68020 68030 68040 68060 6888x |
  6334.      +----------+---------+-------------------------------------------+
  6335.      +----------+---------+-------------------------------------------+
  6336.      | abcd     | b       |   x     x     x     x     x     x         |
  6337.      | add      | b,w,l   |   x     x     x     x     x     x         |
  6338.      | addq     | b,w,l   |   x     x     x     x     x     x         |
  6339.      | adda     | w,l     |   x     x     x     x     x     x         |
  6340.      | addi     | b,w,l   |   x     x     x     x     x     x         |
  6341.      | addx     | b,w,l   |   x     x     x     x     x     x         |
  6342.      | and      | b,w,l   |   x     x     x     x     x     x         |
  6343.      | andi     | b,w,l   |   x     x     x     x     x     x         |
  6344.      | asr      | b,w,l   |   x     x     x     x     x     x         |
  6345.      | asl      | b,w,l   |   x     x     x     x     x     x         |
  6346.      | bcc      | b,w,l   |   x     x     x     x     x     x         |
  6347.      | bchg     | b,l     |   x     x     x     x     x     x         |
  6348.      | bclr     | b,l     |   x     x     x     x     x     x         |
  6349.      | bfchg    | unsized |               x     x     x     x         |
  6350.      | bfclr    | unsized |               x     x     x     x         |
  6351.      | bfext    | unsized |               x     x     x     x         |
  6352.      | bfffo    | unsized |               x     x     x     x         |
  6353.      | bfins    | unsized |               x     x     x     x         |
  6354.      | bfset    | unsized |               x     x     x     x         |
  6355.      | bftst    | unsized |               x     x     x     x         |
  6356.      | bkpt     | unsized |         x     x     x     x     x         |
  6357.      | bset     | b,l     |   x     x     x     x     x     x         |
  6358.      | btst     | b,l     |   x     x     x     x     x     x         |
  6359.      | callm    | unsized |               x                           |
  6360.      | cas      | b,w,l   |   x     x     x     x     x     x,2       |
  6361.      | cas2     | b,w,l   |   x     x     x     x     x     x,2       |
  6362.      | chk      | b,w,l   |   x     x     x     x     x     x         |
  6363.      | chk2     | b,w,l   |               x     x     x     2         |
  6364.      | cinv¹    | unsized |                           x     x         |
  6365.      | clr      | b,w,l   |   x     x     x     x     x     x         |
  6366.      | cmp      | b,w,l   |   x     x     x     x     x     x         |
  6367.      | cmpa     | w,l     |   x     x     x     x     x     x         |
  6368.      | cmpi     | b,w,l   |   x     x     x     x     x     x         |
  6369.      | cmpm     | b,w,l   |   x     x     x     x     x     x         |
  6370.      | cmp2     | b,w,l   |               x     x     x     2         |
  6371.      | cpush¹   | unsized |                           x     x         |
  6372.      | dbcc     | w       |   x     x     x     x     x     x         |
  6373.      | divs     | w,l     |   x     x     x     x     x     x,2       |
  6374.      | divsl    | l       |               x     x     x     x         |
  6375.      | divu     | w,l     |   x     x     x     x     x     x,2       |
  6376.      | divul    | l       |               x     x     x     x         |
  6377.      | eor      | b,w,l   |   x     x     x     x     x     x         |
  6378.      | eori     | b,w,l   |   x     x     x     x     x     x         |
  6379.      | eori/ccr | b       |   x     x     x     x     x     x         |
  6380.      | eori/sr¹ | w       |   x     x     x     x     x     x         |
  6381.      | exg      | l       |   x     x     x     x     x     x         |
  6382.      | ext      | w,l     |   x     x     x     x     x     x         |
  6383.      | extb     | l       |               x     x     x     x         |
  6384.      | fabs     |         |                           x     x     x   |
  6385.      | fsabs    |         |                           x     x         |
  6386.      | fdabs    |         |                           x     x         |
  6387.      | facos    |         |                           2     2     x   |
  6388.      | fadd     |         |                           x     x     x   |
  6389.      | fsadd    |         |                           x     x         |
  6390.      | fdadd    |         |                           x     x         |
  6391.      | fasin    |         |                           2     2     x   |
  6392.      | fatan    |         |                           2     2     x   |
  6393.      | fatanh   |         |                           2     2     x   |
  6394.      | fbcc     |         |                           x     x     x   |
  6395.      | fcmp     |         |                           x     x     x   |
  6396.      | fcos     |         |                           2     2     x   |
  6397.      | fcosh    |         |                           2     2     x   |
  6398.      | fdbcc    |         |                           x     2     x   |
  6399.      | fdiv     |         |                           x     x     x   |
  6400.      | fsdiv    |         |                           x     x         |
  6401.      | fddiv    |         |                           x     x         |
  6402.      | fetox    |         |                           2     2     x   |
  6403.      | fetoxm1  |         |                           2     2     x   |
  6404.      | fgetexp  |         |                           2     2     x   |
  6405.      | fgetman  |         |                           2     2     x   |
  6406.      | fint     |         |                           2     x     x   |
  6407.      | fintrz   |         |                           2     x     x   |
  6408.      | flogn    |         |                           2     2     x   |
  6409.      | flognp1  |         |                           2     2     x   |
  6410.      | flog2    |         |                           2     2     x   |
  6411.      | flog10   |         |                           2     2     x   |
  6412.      | fmod     |         |                           2     2     x   |
  6413.      | fmove    |         |                           x     x     x   |
  6414.      | fsmove   |         |                           x     x         |
  6415.      | fdmove   |         |                           x     x         |
  6416.      | fmovecr  |         |                           2     2     x   |
  6417.      | fmovem   |         |                           x     x,2   x   |
  6418.      | fmul     |         |                           x     x     x   |
  6419.      | fsmul    |         |                           x     x         |
  6420.      | fdmul    |         |                           x     x         |
  6421.      | fneg     |         |                           x     x     x   |
  6422.      | fsneg    |         |                           x     x         |
  6423.      | fdneg    |         |                           x     x         |
  6424.      | fnop     |         |                           x     x     x   |
  6425.      | frem     |         |                           2     2     x   |
  6426.      | frestore¹|         |                           x     x     x   |
  6427.      | fscc     |         |                           2     2     x   |
  6428.      | fsub     |         |                           x     x     x   |
  6429.      | fssub    |         |                           x     x         |
  6430.      | fdsub    |         |                           x     x         |
  6431.      | fsave¹   |         |                           x     x     x   |
  6432.      | fscale   |         |                           2     2     x   |
  6433.      | fsglmul  |         |                           2     2     x   |
  6434.      | fsgldiv  |         |                           2     2     x   |
  6435.      | fsin     |         |                           2     2     x   |
  6436.      | fsinh    |         |                           2     2     x   |
  6437.      | fsincos  |         |                           2     2     x   |
  6438.      | fsqrt    |         |                           x     x     x   |
  6439.      | fssqrt   |         |                           x     x         |
  6440.      | fdsqrt   |         |                           x     x         |
  6441.      | ftan     |         |                           2     2     x   |
  6442.      | ftanh    |         |                           2     2     x   |
  6443.      | ftentox  |         |                           2     2     x   |
  6444.      | ftrap    |         |                           x     2     x   |
  6445.      | ftst     |         |                           x     x     x   |
  6446.      | ftwotox  |         |                           2     2     x   |
  6447.      | illegal  | unsized |   x     x     x     x     x     x         |
  6448.      | jmp      | unsized |   x     x     x     x     x     x         |
  6449.      | jsr      | unsized |   x     x     x     x     x     x         |
  6450.      | lea      | l       |   x     x     x     x     x     x         |
  6451.      | link     | w,l     |   x     x     x     x     x     x         |
  6452.      | lpstop   |         |                                 x         |
  6453.      | lsl      | b,w,l   |   x     x     x     x     x     x         |
  6454.      | lsr      | b,w,l   |   x     x     x     x     x     x         |
  6455.      | move     | b,w,l   |   x     x     x     x     x     x         |
  6456.      | movea    | w,l     |   x     x     x     x     x     x         |
  6457.      | moveq    | l       |   x     x     x     x     x     x         |
  6458.      | movec¹   | l       |         x     x     x     x     x         |
  6459.      | movem    | w,l     |   x     x     x     x     x     x         |
  6460.      | movep    | w,l     |   x     x     x     x     x               |
  6461.      | moves¹   | b,w,l   |         x     x     x     x     x         |
  6462.      | move16   |         |                           x     x         |
  6463.      | muls     | w,l     |   x     x     x     x     x     x         |
  6464.      | mulu     | w,l     |   x     x     x     x     x     x         |
  6465.      | nbcd     | b       |   x     x     x     x     x     x         |
  6466.      | neg      | b,w,l   |   x     x     x     x     x     x         |
  6467.      | negx     | b,w,l   |   x     x     x     x     x     x         |
  6468.      | nop      | unsized |   x     x     x     x     x     x         |
  6469.      | not      | b,w,l   |   x     x     x     x     x     x         |
  6470.      | or       | b,w,l   |   x     x     x     x     x     x         |
  6471.      | ori      | b,w,l   |   x     x     x     x     x     x         |
  6472.      | pack     | unsized |               x     x     x     x         |
  6473.      | pea      | l       |   x     x     x     x     x     x         |
  6474.      | pflush¹  | unsized |                     x     x     x         |
  6475.      | pflusha¹ | unsized |                     x                     |
  6476.      | plpa¹    | unsized |                                 x         |
  6477.      | pload¹   | unsized |                     x                     |
  6478.      | pmove¹   | w,l,q   |                     x                     |
  6479.      | ptest¹   | unsized |                     x     x               |
  6480.      | reset¹   | unsized |   x     x     x     x     x     x         |
  6481.      | rol      | b,w,l   |   x     x     x     x     x     x         |
  6482.      | ror      | b,w,l   |   x     x     x     x     x     x         |
  6483.      | roxl     | b,w,l   |   x     x     x     x     x     x         |
  6484.      | roxr     | b,w,l   |   x     x     x     x     x     x         |
  6485.      | rtd      | unsized |         x     x     x     x     x         |
  6486.      | rte¹     | unsized |   x     x     x     x     x     x         |
  6487.      | rtr      | unsized |   x     x     x     x     x     x         |
  6488.      | rts      | unsized |   x     x     x     x     x     x         |
  6489.      | rtm      | unsized |               x                           |
  6490.      | sbcd     | b       |   x     x     x     x     x     x         |
  6491.      | scc      | b       |   x     x     x     x     x     x         |
  6492.      | stop¹    | unsized |   x     x     x     x     x     x         |
  6493.      | sub      | b,w,l   |   x     x     x     x     x     x         |
  6494.      | subq     | b,w,l   |   x     x     x     x     x     x         |
  6495.      | suba     | w,l     |   x     x     x     x     x     x         |
  6496.      | subi     | b,w,l   |   x     x     x     x     x     x         |
  6497.      | subx     | b,w,l   |   x     x     x     x     x     x         |
  6498.      | swap     | w       |   x     x     x     x     x     x         |
  6499.      | tas      | b       |   x     x     x     x     x     x         |
  6500.      | trap     | unsized |   x     x     x     x     x     x         |
  6501.      | trapcc   | ? ,w,l  |               x     x     x     x         |
  6502.      | trapv    | unsized |   x     x     x     x     x     x         |
  6503.      | tst      | b,w,l   |   x     x     x     x     x     x         |
  6504.      | unlk     | unsized |   x     x     x     x     x     x         |
  6505.      | unpk     | unsized |               x     x     x     x         |
  6506.      +----------+---------+-------------------------------------------+
  6507.      
  6508.      ¹ Supervisor instruction
  6509.      2 These are software-supported instructions on the 68040 and 68060
  6510.  
  6511.